
bin/kernel：     文件格式 elf32-i386


Disassembly of section .text:

c0100000 <kern_entry>:
.text
.globl kern_entry
# kernel中的第一条指令
kern_entry:
    # load pa of boot pgdir
    movl $REALLOC(__boot_pgdir), %eax
c0100000:	b8 00 30 12 00       	mov    $0x123000,%eax
    movl %eax, %cr3
c0100005:	0f 22 d8             	mov    %eax,%cr3

    # enable paging
    movl %cr0, %eax
c0100008:	0f 20 c0             	mov    %cr0,%eax
    orl $(CR0_PE | CR0_PG | CR0_AM | CR0_WP | CR0_NE | CR0_TS | CR0_EM | CR0_MP), %eax
c010000b:	0d 2f 00 05 80       	or     $0x8005002f,%eax
    andl $~(CR0_TS | CR0_EM), %eax
c0100010:	83 e0 f3             	and    $0xfffffff3,%eax
    movl %eax, %cr0
c0100013:	0f 22 c0             	mov    %eax,%cr0

    # update eip
    # now, eip = 0x1.....
    leal next, %eax
c0100016:	8d 05 1e 00 10 c0    	lea    0xc010001e,%eax
    # set eip = KERNBASE + 0x1.....
    jmp *%eax
c010001c:	ff e0                	jmp    *%eax

c010001e <next>:
next:
    # 可以思考下，为什么我们先映射0-4M和0xC0000000-0XC0400000到 物理地址0-4M，再取消0-4M的低虚地址映射呢？
    # unmap va 0 ~ 4M, it's temporary mapping
    xorl %eax, %eax
c010001e:	31 c0                	xor    %eax,%eax
    movl %eax, __boot_pgdir
c0100020:	a3 00 30 12 c0       	mov    %eax,0xc0123000

    # set ebp, esp
    movl $0x0, %ebp
c0100025:	bd 00 00 00 00       	mov    $0x0,%ebp
    # the kernel stack region is from bootstack -- bootstacktop,
    # the kernel stack size is KSTACKSIZE (8KB)defined in memlayout.h
    # 这里的内核栈大小只有8K，所以在内核中代码中，谨慎在函数调用中使用占据大量空间的数据结构，这种数据结构应该使用kmalloc/kfree函数
    # 放在内核栈空间以外的内核空间中
    movl $bootstacktop, %esp
c010002a:	bc 00 20 12 c0       	mov    $0xc0122000,%esp
    # now kernel stack is ready , call the first C function
    call kern_init
c010002f:	e8 02 00 00 00       	call   c0100036 <kern_init>

c0100034 <spin>:

# should never get here
spin:
    jmp spin
c0100034:	eb fe                	jmp    c0100034 <spin>

c0100036 <kern_init>:
int kern_init(void) __attribute__((noreturn));

static void lab1_switch_test(void);

int
kern_init(void) {
c0100036:	f3 0f 1e fb          	endbr32 
c010003a:	55                   	push   %ebp
c010003b:	89 e5                	mov    %esp,%ebp
c010003d:	83 ec 18             	sub    $0x18,%esp
    extern char edata[], end[];
    memset(edata, 0, end - edata);
c0100040:	b8 fc 60 12 c0       	mov    $0xc01260fc,%eax
c0100045:	2d 00 50 12 c0       	sub    $0xc0125000,%eax
c010004a:	83 ec 04             	sub    $0x4,%esp
c010004d:	50                   	push   %eax
c010004e:	6a 00                	push   $0x0
c0100050:	68 00 50 12 c0       	push   $0xc0125000
c0100055:	e8 77 7b 00 00       	call   c0107bd1 <memset>
c010005a:	83 c4 10             	add    $0x10,%esp

    cons_init();                // init the console
c010005d:	e8 46 1e 00 00       	call   c0101ea8 <cons_init>

    const char *message = "UCORE os is loading ...";
c0100062:	c7 45 f4 80 84 10 c0 	movl   $0xc0108480,-0xc(%ebp)
    cprintf("%s\n\n", message);
c0100069:	83 ec 08             	sub    $0x8,%esp
c010006c:	ff 75 f4             	pushl  -0xc(%ebp)
c010006f:	68 98 84 10 c0       	push   $0xc0108498
c0100074:	e8 31 02 00 00       	call   c01002aa <cprintf>
c0100079:	83 c4 10             	add    $0x10,%esp

    print_kerninfo();
c010007c:	e8 e5 08 00 00       	call   c0100966 <print_kerninfo>

    grade_backtrace();
c0100081:	e8 8f 00 00 00       	call   c0100115 <grade_backtrace>

    pmm_init();                 // init physical memory management
c0100086:	e8 61 67 00 00       	call   c01067ec <pmm_init>

    pic_init();                 // init interrupt controller
c010008b:	e8 a0 1f 00 00       	call   c0102030 <pic_init>
    idt_init();                 // init interrupt descriptor table
c0100090:	e8 21 21 00 00       	call   c01021b6 <idt_init>

    vmm_init();                 // init virtual memory management
c0100095:	e8 99 35 00 00       	call   c0103633 <vmm_init>

    ide_init();                 // init ide devices
c010009a:	e8 d6 0d 00 00       	call   c0100e75 <ide_init>
    swap_init();                // init swap
c010009f:	e8 38 43 00 00       	call   c01043dc <swap_init>

    clock_init();               // init clock interrupt
c01000a4:	e8 46 15 00 00       	call   c01015ef <clock_init>
    intr_enable();              // enable irq interrupt
c01000a9:	e8 d1 20 00 00       	call   c010217f <intr_enable>
    //LAB1: CAHLLENGE 1 If you try to do it, uncomment lab1_switch_test()
    // user/kernel mode switch test
    //lab1_switch_test();

    /* do nothing */
    while (1);
c01000ae:	eb fe                	jmp    c01000ae <kern_init+0x78>

c01000b0 <grade_backtrace2>:
}

void __attribute__((noinline))
grade_backtrace2(int arg0, int arg1, int arg2, int arg3) {
c01000b0:	f3 0f 1e fb          	endbr32 
c01000b4:	55                   	push   %ebp
c01000b5:	89 e5                	mov    %esp,%ebp
c01000b7:	83 ec 08             	sub    $0x8,%esp
    mon_backtrace(0, NULL, NULL);
c01000ba:	83 ec 04             	sub    $0x4,%esp
c01000bd:	6a 00                	push   $0x0
c01000bf:	6a 00                	push   $0x0
c01000c1:	6a 00                	push   $0x0
c01000c3:	e8 39 0d 00 00       	call   c0100e01 <mon_backtrace>
c01000c8:	83 c4 10             	add    $0x10,%esp
}
c01000cb:	90                   	nop
c01000cc:	c9                   	leave  
c01000cd:	c3                   	ret    

c01000ce <grade_backtrace1>:

void __attribute__((noinline))
grade_backtrace1(int arg0, int arg1) {
c01000ce:	f3 0f 1e fb          	endbr32 
c01000d2:	55                   	push   %ebp
c01000d3:	89 e5                	mov    %esp,%ebp
c01000d5:	53                   	push   %ebx
c01000d6:	83 ec 04             	sub    $0x4,%esp
    grade_backtrace2(arg0, (int)&arg0, arg1, (int)&arg1);
c01000d9:	8d 4d 0c             	lea    0xc(%ebp),%ecx
c01000dc:	8b 55 0c             	mov    0xc(%ebp),%edx
c01000df:	8d 5d 08             	lea    0x8(%ebp),%ebx
c01000e2:	8b 45 08             	mov    0x8(%ebp),%eax
c01000e5:	51                   	push   %ecx
c01000e6:	52                   	push   %edx
c01000e7:	53                   	push   %ebx
c01000e8:	50                   	push   %eax
c01000e9:	e8 c2 ff ff ff       	call   c01000b0 <grade_backtrace2>
c01000ee:	83 c4 10             	add    $0x10,%esp
}
c01000f1:	90                   	nop
c01000f2:	8b 5d fc             	mov    -0x4(%ebp),%ebx
c01000f5:	c9                   	leave  
c01000f6:	c3                   	ret    

c01000f7 <grade_backtrace0>:

void __attribute__((noinline))
grade_backtrace0(int arg0, int arg1, int arg2) {
c01000f7:	f3 0f 1e fb          	endbr32 
c01000fb:	55                   	push   %ebp
c01000fc:	89 e5                	mov    %esp,%ebp
c01000fe:	83 ec 08             	sub    $0x8,%esp
    grade_backtrace1(arg0, arg2);
c0100101:	83 ec 08             	sub    $0x8,%esp
c0100104:	ff 75 10             	pushl  0x10(%ebp)
c0100107:	ff 75 08             	pushl  0x8(%ebp)
c010010a:	e8 bf ff ff ff       	call   c01000ce <grade_backtrace1>
c010010f:	83 c4 10             	add    $0x10,%esp
}
c0100112:	90                   	nop
c0100113:	c9                   	leave  
c0100114:	c3                   	ret    

c0100115 <grade_backtrace>:

void
grade_backtrace(void) {
c0100115:	f3 0f 1e fb          	endbr32 
c0100119:	55                   	push   %ebp
c010011a:	89 e5                	mov    %esp,%ebp
c010011c:	83 ec 08             	sub    $0x8,%esp
    grade_backtrace0(0, (int)kern_init, 0xffff0000);
c010011f:	b8 36 00 10 c0       	mov    $0xc0100036,%eax
c0100124:	83 ec 04             	sub    $0x4,%esp
c0100127:	68 00 00 ff ff       	push   $0xffff0000
c010012c:	50                   	push   %eax
c010012d:	6a 00                	push   $0x0
c010012f:	e8 c3 ff ff ff       	call   c01000f7 <grade_backtrace0>
c0100134:	83 c4 10             	add    $0x10,%esp
}
c0100137:	90                   	nop
c0100138:	c9                   	leave  
c0100139:	c3                   	ret    

c010013a <lab1_print_cur_status>:

static void
lab1_print_cur_status(void) {
c010013a:	f3 0f 1e fb          	endbr32 
c010013e:	55                   	push   %ebp
c010013f:	89 e5                	mov    %esp,%ebp
c0100141:	83 ec 18             	sub    $0x18,%esp
    static int round = 0;
    uint16_t reg1, reg2, reg3, reg4;
    asm volatile (
c0100144:	8c 4d f6             	mov    %cs,-0xa(%ebp)
c0100147:	8c 5d f4             	mov    %ds,-0xc(%ebp)
c010014a:	8c 45 f2             	mov    %es,-0xe(%ebp)
c010014d:	8c 55 f0             	mov    %ss,-0x10(%ebp)
            "mov %%cs, %0;"
            "mov %%ds, %1;"
            "mov %%es, %2;"
            "mov %%ss, %3;"
            : "=m"(reg1), "=m"(reg2), "=m"(reg3), "=m"(reg4));
    cprintf("%d: @ring %d\n", round, reg1 & 3);
c0100150:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c0100154:	0f b7 c0             	movzwl %ax,%eax
c0100157:	83 e0 03             	and    $0x3,%eax
c010015a:	89 c2                	mov    %eax,%edx
c010015c:	a1 00 50 12 c0       	mov    0xc0125000,%eax
c0100161:	83 ec 04             	sub    $0x4,%esp
c0100164:	52                   	push   %edx
c0100165:	50                   	push   %eax
c0100166:	68 9d 84 10 c0       	push   $0xc010849d
c010016b:	e8 3a 01 00 00       	call   c01002aa <cprintf>
c0100170:	83 c4 10             	add    $0x10,%esp
    cprintf("%d:  cs = %x\n", round, reg1);
c0100173:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c0100177:	0f b7 d0             	movzwl %ax,%edx
c010017a:	a1 00 50 12 c0       	mov    0xc0125000,%eax
c010017f:	83 ec 04             	sub    $0x4,%esp
c0100182:	52                   	push   %edx
c0100183:	50                   	push   %eax
c0100184:	68 ab 84 10 c0       	push   $0xc01084ab
c0100189:	e8 1c 01 00 00       	call   c01002aa <cprintf>
c010018e:	83 c4 10             	add    $0x10,%esp
    cprintf("%d:  ds = %x\n", round, reg2);
c0100191:	0f b7 45 f4          	movzwl -0xc(%ebp),%eax
c0100195:	0f b7 d0             	movzwl %ax,%edx
c0100198:	a1 00 50 12 c0       	mov    0xc0125000,%eax
c010019d:	83 ec 04             	sub    $0x4,%esp
c01001a0:	52                   	push   %edx
c01001a1:	50                   	push   %eax
c01001a2:	68 b9 84 10 c0       	push   $0xc01084b9
c01001a7:	e8 fe 00 00 00       	call   c01002aa <cprintf>
c01001ac:	83 c4 10             	add    $0x10,%esp
    cprintf("%d:  es = %x\n", round, reg3);
c01001af:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c01001b3:	0f b7 d0             	movzwl %ax,%edx
c01001b6:	a1 00 50 12 c0       	mov    0xc0125000,%eax
c01001bb:	83 ec 04             	sub    $0x4,%esp
c01001be:	52                   	push   %edx
c01001bf:	50                   	push   %eax
c01001c0:	68 c7 84 10 c0       	push   $0xc01084c7
c01001c5:	e8 e0 00 00 00       	call   c01002aa <cprintf>
c01001ca:	83 c4 10             	add    $0x10,%esp
    cprintf("%d:  ss = %x\n", round, reg4);
c01001cd:	0f b7 45 f0          	movzwl -0x10(%ebp),%eax
c01001d1:	0f b7 d0             	movzwl %ax,%edx
c01001d4:	a1 00 50 12 c0       	mov    0xc0125000,%eax
c01001d9:	83 ec 04             	sub    $0x4,%esp
c01001dc:	52                   	push   %edx
c01001dd:	50                   	push   %eax
c01001de:	68 d5 84 10 c0       	push   $0xc01084d5
c01001e3:	e8 c2 00 00 00       	call   c01002aa <cprintf>
c01001e8:	83 c4 10             	add    $0x10,%esp
    round ++;
c01001eb:	a1 00 50 12 c0       	mov    0xc0125000,%eax
c01001f0:	83 c0 01             	add    $0x1,%eax
c01001f3:	a3 00 50 12 c0       	mov    %eax,0xc0125000
}
c01001f8:	90                   	nop
c01001f9:	c9                   	leave  
c01001fa:	c3                   	ret    

c01001fb <lab1_switch_to_user>:

static void
lab1_switch_to_user(void) {
c01001fb:	f3 0f 1e fb          	endbr32 
c01001ff:	55                   	push   %ebp
c0100200:	89 e5                	mov    %esp,%ebp
    //LAB1 CHALLENGE 1 : TODO
}
c0100202:	90                   	nop
c0100203:	5d                   	pop    %ebp
c0100204:	c3                   	ret    

c0100205 <lab1_switch_to_kernel>:

static void
lab1_switch_to_kernel(void) {
c0100205:	f3 0f 1e fb          	endbr32 
c0100209:	55                   	push   %ebp
c010020a:	89 e5                	mov    %esp,%ebp
    //LAB1 CHALLENGE 1 :  TODO
}
c010020c:	90                   	nop
c010020d:	5d                   	pop    %ebp
c010020e:	c3                   	ret    

c010020f <lab1_switch_test>:

static void
lab1_switch_test(void) {
c010020f:	f3 0f 1e fb          	endbr32 
c0100213:	55                   	push   %ebp
c0100214:	89 e5                	mov    %esp,%ebp
c0100216:	83 ec 08             	sub    $0x8,%esp
    lab1_print_cur_status();
c0100219:	e8 1c ff ff ff       	call   c010013a <lab1_print_cur_status>
    cprintf("+++ switch to  user  mode +++\n");
c010021e:	83 ec 0c             	sub    $0xc,%esp
c0100221:	68 e4 84 10 c0       	push   $0xc01084e4
c0100226:	e8 7f 00 00 00       	call   c01002aa <cprintf>
c010022b:	83 c4 10             	add    $0x10,%esp
    lab1_switch_to_user();
c010022e:	e8 c8 ff ff ff       	call   c01001fb <lab1_switch_to_user>
    lab1_print_cur_status();
c0100233:	e8 02 ff ff ff       	call   c010013a <lab1_print_cur_status>
    cprintf("+++ switch to kernel mode +++\n");
c0100238:	83 ec 0c             	sub    $0xc,%esp
c010023b:	68 04 85 10 c0       	push   $0xc0108504
c0100240:	e8 65 00 00 00       	call   c01002aa <cprintf>
c0100245:	83 c4 10             	add    $0x10,%esp
    lab1_switch_to_kernel();
c0100248:	e8 b8 ff ff ff       	call   c0100205 <lab1_switch_to_kernel>
    lab1_print_cur_status();
c010024d:	e8 e8 fe ff ff       	call   c010013a <lab1_print_cur_status>
}
c0100252:	90                   	nop
c0100253:	c9                   	leave  
c0100254:	c3                   	ret    

c0100255 <cputch>:
/* *
 * cputch - writes a single character @c to stdout, and it will
 * increace the value of counter pointed by @cnt.
 * */
static void
cputch(int c, int *cnt) {
c0100255:	f3 0f 1e fb          	endbr32 
c0100259:	55                   	push   %ebp
c010025a:	89 e5                	mov    %esp,%ebp
c010025c:	83 ec 08             	sub    $0x8,%esp
    cons_putc(c);
c010025f:	83 ec 0c             	sub    $0xc,%esp
c0100262:	ff 75 08             	pushl  0x8(%ebp)
c0100265:	e8 73 1c 00 00       	call   c0101edd <cons_putc>
c010026a:	83 c4 10             	add    $0x10,%esp
    (*cnt) ++;
c010026d:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100270:	8b 00                	mov    (%eax),%eax
c0100272:	8d 50 01             	lea    0x1(%eax),%edx
c0100275:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100278:	89 10                	mov    %edx,(%eax)
}
c010027a:	90                   	nop
c010027b:	c9                   	leave  
c010027c:	c3                   	ret    

c010027d <vcprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want cprintf() instead.
 * */
int
vcprintf(const char *fmt, va_list ap) {
c010027d:	f3 0f 1e fb          	endbr32 
c0100281:	55                   	push   %ebp
c0100282:	89 e5                	mov    %esp,%ebp
c0100284:	83 ec 18             	sub    $0x18,%esp
    int cnt = 0;
c0100287:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    vprintfmt((void*)cputch, &cnt, fmt, ap);
c010028e:	ff 75 0c             	pushl  0xc(%ebp)
c0100291:	ff 75 08             	pushl  0x8(%ebp)
c0100294:	8d 45 f4             	lea    -0xc(%ebp),%eax
c0100297:	50                   	push   %eax
c0100298:	68 55 02 10 c0       	push   $0xc0100255
c010029d:	e8 7e 7c 00 00       	call   c0107f20 <vprintfmt>
c01002a2:	83 c4 10             	add    $0x10,%esp
    return cnt;
c01002a5:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c01002a8:	c9                   	leave  
c01002a9:	c3                   	ret    

c01002aa <cprintf>:
 *
 * The return value is the number of characters which would be
 * written to stdout.
 * */
int
cprintf(const char *fmt, ...) {
c01002aa:	f3 0f 1e fb          	endbr32 
c01002ae:	55                   	push   %ebp
c01002af:	89 e5                	mov    %esp,%ebp
c01002b1:	83 ec 18             	sub    $0x18,%esp
    va_list ap;
    int cnt;
    va_start(ap, fmt);
c01002b4:	8d 45 0c             	lea    0xc(%ebp),%eax
c01002b7:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cnt = vcprintf(fmt, ap);
c01002ba:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01002bd:	83 ec 08             	sub    $0x8,%esp
c01002c0:	50                   	push   %eax
c01002c1:	ff 75 08             	pushl  0x8(%ebp)
c01002c4:	e8 b4 ff ff ff       	call   c010027d <vcprintf>
c01002c9:	83 c4 10             	add    $0x10,%esp
c01002cc:	89 45 f4             	mov    %eax,-0xc(%ebp)
    va_end(ap);
    return cnt;
c01002cf:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c01002d2:	c9                   	leave  
c01002d3:	c3                   	ret    

c01002d4 <cputchar>:

/* cputchar - writes a single character to stdout */
void
cputchar(int c) {
c01002d4:	f3 0f 1e fb          	endbr32 
c01002d8:	55                   	push   %ebp
c01002d9:	89 e5                	mov    %esp,%ebp
c01002db:	83 ec 08             	sub    $0x8,%esp
    cons_putc(c);
c01002de:	83 ec 0c             	sub    $0xc,%esp
c01002e1:	ff 75 08             	pushl  0x8(%ebp)
c01002e4:	e8 f4 1b 00 00       	call   c0101edd <cons_putc>
c01002e9:	83 c4 10             	add    $0x10,%esp
}
c01002ec:	90                   	nop
c01002ed:	c9                   	leave  
c01002ee:	c3                   	ret    

c01002ef <cputs>:
/* *
 * cputs- writes the string pointed by @str to stdout and
 * appends a newline character.
 * */
int
cputs(const char *str) {
c01002ef:	f3 0f 1e fb          	endbr32 
c01002f3:	55                   	push   %ebp
c01002f4:	89 e5                	mov    %esp,%ebp
c01002f6:	83 ec 18             	sub    $0x18,%esp
    int cnt = 0;
c01002f9:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    char c;
    while ((c = *str ++) != '\0') {
c0100300:	eb 14                	jmp    c0100316 <cputs+0x27>
        cputch(c, &cnt);
c0100302:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
c0100306:	83 ec 08             	sub    $0x8,%esp
c0100309:	8d 55 f0             	lea    -0x10(%ebp),%edx
c010030c:	52                   	push   %edx
c010030d:	50                   	push   %eax
c010030e:	e8 42 ff ff ff       	call   c0100255 <cputch>
c0100313:	83 c4 10             	add    $0x10,%esp
    while ((c = *str ++) != '\0') {
c0100316:	8b 45 08             	mov    0x8(%ebp),%eax
c0100319:	8d 50 01             	lea    0x1(%eax),%edx
c010031c:	89 55 08             	mov    %edx,0x8(%ebp)
c010031f:	0f b6 00             	movzbl (%eax),%eax
c0100322:	88 45 f7             	mov    %al,-0x9(%ebp)
c0100325:	80 7d f7 00          	cmpb   $0x0,-0x9(%ebp)
c0100329:	75 d7                	jne    c0100302 <cputs+0x13>
    }
    cputch('\n', &cnt);
c010032b:	83 ec 08             	sub    $0x8,%esp
c010032e:	8d 45 f0             	lea    -0x10(%ebp),%eax
c0100331:	50                   	push   %eax
c0100332:	6a 0a                	push   $0xa
c0100334:	e8 1c ff ff ff       	call   c0100255 <cputch>
c0100339:	83 c4 10             	add    $0x10,%esp
    return cnt;
c010033c:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
c010033f:	c9                   	leave  
c0100340:	c3                   	ret    

c0100341 <getchar>:

/* getchar - reads a single non-zero character from stdin */
int
getchar(void) {
c0100341:	f3 0f 1e fb          	endbr32 
c0100345:	55                   	push   %ebp
c0100346:	89 e5                	mov    %esp,%ebp
c0100348:	83 ec 18             	sub    $0x18,%esp
    int c;
    while ((c = cons_getc()) == 0)
c010034b:	90                   	nop
c010034c:	e8 d9 1b 00 00       	call   c0101f2a <cons_getc>
c0100351:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0100354:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0100358:	74 f2                	je     c010034c <getchar+0xb>
        /* do nothing */;
    return c;
c010035a:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c010035d:	c9                   	leave  
c010035e:	c3                   	ret    

c010035f <readline>:
 * The readline() function returns the text of the line read. If some errors
 * are happened, NULL is returned. The return value is a global variable,
 * thus it should be copied before it is used.
 * */
char *
readline(const char *prompt) {
c010035f:	f3 0f 1e fb          	endbr32 
c0100363:	55                   	push   %ebp
c0100364:	89 e5                	mov    %esp,%ebp
c0100366:	83 ec 18             	sub    $0x18,%esp
    if (prompt != NULL) {
c0100369:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c010036d:	74 13                	je     c0100382 <readline+0x23>
        cprintf("%s", prompt);
c010036f:	83 ec 08             	sub    $0x8,%esp
c0100372:	ff 75 08             	pushl  0x8(%ebp)
c0100375:	68 23 85 10 c0       	push   $0xc0108523
c010037a:	e8 2b ff ff ff       	call   c01002aa <cprintf>
c010037f:	83 c4 10             	add    $0x10,%esp
    }
    int i = 0, c;
c0100382:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    while (1) {
        c = getchar();
c0100389:	e8 b3 ff ff ff       	call   c0100341 <getchar>
c010038e:	89 45 f0             	mov    %eax,-0x10(%ebp)
        if (c < 0) {
c0100391:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0100395:	79 0a                	jns    c01003a1 <readline+0x42>
            return NULL;
c0100397:	b8 00 00 00 00       	mov    $0x0,%eax
c010039c:	e9 82 00 00 00       	jmp    c0100423 <readline+0xc4>
        }
        else if (c >= ' ' && i < BUFSIZE - 1) {
c01003a1:	83 7d f0 1f          	cmpl   $0x1f,-0x10(%ebp)
c01003a5:	7e 2b                	jle    c01003d2 <readline+0x73>
c01003a7:	81 7d f4 fe 03 00 00 	cmpl   $0x3fe,-0xc(%ebp)
c01003ae:	7f 22                	jg     c01003d2 <readline+0x73>
            cputchar(c);
c01003b0:	83 ec 0c             	sub    $0xc,%esp
c01003b3:	ff 75 f0             	pushl  -0x10(%ebp)
c01003b6:	e8 19 ff ff ff       	call   c01002d4 <cputchar>
c01003bb:	83 c4 10             	add    $0x10,%esp
            buf[i ++] = c;
c01003be:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01003c1:	8d 50 01             	lea    0x1(%eax),%edx
c01003c4:	89 55 f4             	mov    %edx,-0xc(%ebp)
c01003c7:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01003ca:	88 90 20 50 12 c0    	mov    %dl,-0x3fedafe0(%eax)
c01003d0:	eb 4c                	jmp    c010041e <readline+0xbf>
        }
        else if (c == '\b' && i > 0) {
c01003d2:	83 7d f0 08          	cmpl   $0x8,-0x10(%ebp)
c01003d6:	75 1a                	jne    c01003f2 <readline+0x93>
c01003d8:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01003dc:	7e 14                	jle    c01003f2 <readline+0x93>
            cputchar(c);
c01003de:	83 ec 0c             	sub    $0xc,%esp
c01003e1:	ff 75 f0             	pushl  -0x10(%ebp)
c01003e4:	e8 eb fe ff ff       	call   c01002d4 <cputchar>
c01003e9:	83 c4 10             	add    $0x10,%esp
            i --;
c01003ec:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
c01003f0:	eb 2c                	jmp    c010041e <readline+0xbf>
        }
        else if (c == '\n' || c == '\r') {
c01003f2:	83 7d f0 0a          	cmpl   $0xa,-0x10(%ebp)
c01003f6:	74 06                	je     c01003fe <readline+0x9f>
c01003f8:	83 7d f0 0d          	cmpl   $0xd,-0x10(%ebp)
c01003fc:	75 8b                	jne    c0100389 <readline+0x2a>
            cputchar(c);
c01003fe:	83 ec 0c             	sub    $0xc,%esp
c0100401:	ff 75 f0             	pushl  -0x10(%ebp)
c0100404:	e8 cb fe ff ff       	call   c01002d4 <cputchar>
c0100409:	83 c4 10             	add    $0x10,%esp
            buf[i] = '\0';
c010040c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010040f:	05 20 50 12 c0       	add    $0xc0125020,%eax
c0100414:	c6 00 00             	movb   $0x0,(%eax)
            return buf;
c0100417:	b8 20 50 12 c0       	mov    $0xc0125020,%eax
c010041c:	eb 05                	jmp    c0100423 <readline+0xc4>
        c = getchar();
c010041e:	e9 66 ff ff ff       	jmp    c0100389 <readline+0x2a>
        }
    }
}
c0100423:	c9                   	leave  
c0100424:	c3                   	ret    

c0100425 <__panic>:
/* *
 * __panic - __panic is called on unresolvable fatal errors. it prints
 * "panic: 'message'", and then enters the kernel monitor.
 * */
void
__panic(const char *file, int line, const char *fmt, ...) {
c0100425:	f3 0f 1e fb          	endbr32 
c0100429:	55                   	push   %ebp
c010042a:	89 e5                	mov    %esp,%ebp
c010042c:	83 ec 18             	sub    $0x18,%esp
    if (is_panic) {
c010042f:	a1 20 54 12 c0       	mov    0xc0125420,%eax
c0100434:	85 c0                	test   %eax,%eax
c0100436:	75 5f                	jne    c0100497 <__panic+0x72>
        goto panic_dead;
    }
    is_panic = 1;
c0100438:	c7 05 20 54 12 c0 01 	movl   $0x1,0xc0125420
c010043f:	00 00 00 

    // print the 'message'
    va_list ap;
    va_start(ap, fmt);
c0100442:	8d 45 14             	lea    0x14(%ebp),%eax
c0100445:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("kernel panic at %s:%d:\n    ", file, line);
c0100448:	83 ec 04             	sub    $0x4,%esp
c010044b:	ff 75 0c             	pushl  0xc(%ebp)
c010044e:	ff 75 08             	pushl  0x8(%ebp)
c0100451:	68 26 85 10 c0       	push   $0xc0108526
c0100456:	e8 4f fe ff ff       	call   c01002aa <cprintf>
c010045b:	83 c4 10             	add    $0x10,%esp
    vcprintf(fmt, ap);
c010045e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100461:	83 ec 08             	sub    $0x8,%esp
c0100464:	50                   	push   %eax
c0100465:	ff 75 10             	pushl  0x10(%ebp)
c0100468:	e8 10 fe ff ff       	call   c010027d <vcprintf>
c010046d:	83 c4 10             	add    $0x10,%esp
    cprintf("\n");
c0100470:	83 ec 0c             	sub    $0xc,%esp
c0100473:	68 42 85 10 c0       	push   $0xc0108542
c0100478:	e8 2d fe ff ff       	call   c01002aa <cprintf>
c010047d:	83 c4 10             	add    $0x10,%esp
    
    cprintf("stack trackback:\n");
c0100480:	83 ec 0c             	sub    $0xc,%esp
c0100483:	68 44 85 10 c0       	push   $0xc0108544
c0100488:	e8 1d fe ff ff       	call   c01002aa <cprintf>
c010048d:	83 c4 10             	add    $0x10,%esp
    print_stackframe();
c0100490:	e8 25 06 00 00       	call   c0100aba <print_stackframe>
c0100495:	eb 01                	jmp    c0100498 <__panic+0x73>
        goto panic_dead;
c0100497:	90                   	nop
    
    va_end(ap);

panic_dead:
    intr_disable();
c0100498:	e8 ee 1c 00 00       	call   c010218b <intr_disable>
    while (1) {
        kmonitor(NULL);
c010049d:	83 ec 0c             	sub    $0xc,%esp
c01004a0:	6a 00                	push   $0x0
c01004a2:	e8 74 08 00 00       	call   c0100d1b <kmonitor>
c01004a7:	83 c4 10             	add    $0x10,%esp
c01004aa:	eb f1                	jmp    c010049d <__panic+0x78>

c01004ac <__warn>:
    }
}

/* __warn - like panic, but don't */
void
__warn(const char *file, int line, const char *fmt, ...) {
c01004ac:	f3 0f 1e fb          	endbr32 
c01004b0:	55                   	push   %ebp
c01004b1:	89 e5                	mov    %esp,%ebp
c01004b3:	83 ec 18             	sub    $0x18,%esp
    va_list ap;
    va_start(ap, fmt);
c01004b6:	8d 45 14             	lea    0x14(%ebp),%eax
c01004b9:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("kernel warning at %s:%d:\n    ", file, line);
c01004bc:	83 ec 04             	sub    $0x4,%esp
c01004bf:	ff 75 0c             	pushl  0xc(%ebp)
c01004c2:	ff 75 08             	pushl  0x8(%ebp)
c01004c5:	68 56 85 10 c0       	push   $0xc0108556
c01004ca:	e8 db fd ff ff       	call   c01002aa <cprintf>
c01004cf:	83 c4 10             	add    $0x10,%esp
    vcprintf(fmt, ap);
c01004d2:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01004d5:	83 ec 08             	sub    $0x8,%esp
c01004d8:	50                   	push   %eax
c01004d9:	ff 75 10             	pushl  0x10(%ebp)
c01004dc:	e8 9c fd ff ff       	call   c010027d <vcprintf>
c01004e1:	83 c4 10             	add    $0x10,%esp
    cprintf("\n");
c01004e4:	83 ec 0c             	sub    $0xc,%esp
c01004e7:	68 42 85 10 c0       	push   $0xc0108542
c01004ec:	e8 b9 fd ff ff       	call   c01002aa <cprintf>
c01004f1:	83 c4 10             	add    $0x10,%esp
    va_end(ap);
}
c01004f4:	90                   	nop
c01004f5:	c9                   	leave  
c01004f6:	c3                   	ret    

c01004f7 <is_kernel_panic>:

bool
is_kernel_panic(void) {
c01004f7:	f3 0f 1e fb          	endbr32 
c01004fb:	55                   	push   %ebp
c01004fc:	89 e5                	mov    %esp,%ebp
    return is_panic;
c01004fe:	a1 20 54 12 c0       	mov    0xc0125420,%eax
}
c0100503:	5d                   	pop    %ebp
c0100504:	c3                   	ret    

c0100505 <stab_binsearch>:
 *      stab_binsearch(stabs, &left, &right, N_SO, 0xf0100184);
 * will exit setting left = 118, right = 554.
 * */
static void
stab_binsearch(const struct stab *stabs, int *region_left, int *region_right,
           int type, uintptr_t addr) {
c0100505:	f3 0f 1e fb          	endbr32 
c0100509:	55                   	push   %ebp
c010050a:	89 e5                	mov    %esp,%ebp
c010050c:	83 ec 20             	sub    $0x20,%esp
    int l = *region_left, r = *region_right, any_matches = 0;
c010050f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100512:	8b 00                	mov    (%eax),%eax
c0100514:	89 45 fc             	mov    %eax,-0x4(%ebp)
c0100517:	8b 45 10             	mov    0x10(%ebp),%eax
c010051a:	8b 00                	mov    (%eax),%eax
c010051c:	89 45 f8             	mov    %eax,-0x8(%ebp)
c010051f:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

    while (l <= r) {
c0100526:	e9 d2 00 00 00       	jmp    c01005fd <stab_binsearch+0xf8>
        int true_m = (l + r) / 2, m = true_m;
c010052b:	8b 55 fc             	mov    -0x4(%ebp),%edx
c010052e:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100531:	01 d0                	add    %edx,%eax
c0100533:	89 c2                	mov    %eax,%edx
c0100535:	c1 ea 1f             	shr    $0x1f,%edx
c0100538:	01 d0                	add    %edx,%eax
c010053a:	d1 f8                	sar    %eax
c010053c:	89 45 ec             	mov    %eax,-0x14(%ebp)
c010053f:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100542:	89 45 f0             	mov    %eax,-0x10(%ebp)

        // search for earliest stab with right type
        while (m >= l && stabs[m].n_type != type) {
c0100545:	eb 04                	jmp    c010054b <stab_binsearch+0x46>
            m --;
c0100547:	83 6d f0 01          	subl   $0x1,-0x10(%ebp)
        while (m >= l && stabs[m].n_type != type) {
c010054b:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010054e:	3b 45 fc             	cmp    -0x4(%ebp),%eax
c0100551:	7c 1f                	jl     c0100572 <stab_binsearch+0x6d>
c0100553:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0100556:	89 d0                	mov    %edx,%eax
c0100558:	01 c0                	add    %eax,%eax
c010055a:	01 d0                	add    %edx,%eax
c010055c:	c1 e0 02             	shl    $0x2,%eax
c010055f:	89 c2                	mov    %eax,%edx
c0100561:	8b 45 08             	mov    0x8(%ebp),%eax
c0100564:	01 d0                	add    %edx,%eax
c0100566:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c010056a:	0f b6 c0             	movzbl %al,%eax
c010056d:	39 45 14             	cmp    %eax,0x14(%ebp)
c0100570:	75 d5                	jne    c0100547 <stab_binsearch+0x42>
        }
        if (m < l) {    // no match in [l, m]
c0100572:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100575:	3b 45 fc             	cmp    -0x4(%ebp),%eax
c0100578:	7d 0b                	jge    c0100585 <stab_binsearch+0x80>
            l = true_m + 1;
c010057a:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010057d:	83 c0 01             	add    $0x1,%eax
c0100580:	89 45 fc             	mov    %eax,-0x4(%ebp)
            continue;
c0100583:	eb 78                	jmp    c01005fd <stab_binsearch+0xf8>
        }

        // actual binary search
        any_matches = 1;
c0100585:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
        if (stabs[m].n_value < addr) {
c010058c:	8b 55 f0             	mov    -0x10(%ebp),%edx
c010058f:	89 d0                	mov    %edx,%eax
c0100591:	01 c0                	add    %eax,%eax
c0100593:	01 d0                	add    %edx,%eax
c0100595:	c1 e0 02             	shl    $0x2,%eax
c0100598:	89 c2                	mov    %eax,%edx
c010059a:	8b 45 08             	mov    0x8(%ebp),%eax
c010059d:	01 d0                	add    %edx,%eax
c010059f:	8b 40 08             	mov    0x8(%eax),%eax
c01005a2:	39 45 18             	cmp    %eax,0x18(%ebp)
c01005a5:	76 13                	jbe    c01005ba <stab_binsearch+0xb5>
            *region_left = m;
c01005a7:	8b 45 0c             	mov    0xc(%ebp),%eax
c01005aa:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01005ad:	89 10                	mov    %edx,(%eax)
            l = true_m + 1;
c01005af:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01005b2:	83 c0 01             	add    $0x1,%eax
c01005b5:	89 45 fc             	mov    %eax,-0x4(%ebp)
c01005b8:	eb 43                	jmp    c01005fd <stab_binsearch+0xf8>
        } else if (stabs[m].n_value > addr) {
c01005ba:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01005bd:	89 d0                	mov    %edx,%eax
c01005bf:	01 c0                	add    %eax,%eax
c01005c1:	01 d0                	add    %edx,%eax
c01005c3:	c1 e0 02             	shl    $0x2,%eax
c01005c6:	89 c2                	mov    %eax,%edx
c01005c8:	8b 45 08             	mov    0x8(%ebp),%eax
c01005cb:	01 d0                	add    %edx,%eax
c01005cd:	8b 40 08             	mov    0x8(%eax),%eax
c01005d0:	39 45 18             	cmp    %eax,0x18(%ebp)
c01005d3:	73 16                	jae    c01005eb <stab_binsearch+0xe6>
            *region_right = m - 1;
c01005d5:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01005d8:	8d 50 ff             	lea    -0x1(%eax),%edx
c01005db:	8b 45 10             	mov    0x10(%ebp),%eax
c01005de:	89 10                	mov    %edx,(%eax)
            r = m - 1;
c01005e0:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01005e3:	83 e8 01             	sub    $0x1,%eax
c01005e6:	89 45 f8             	mov    %eax,-0x8(%ebp)
c01005e9:	eb 12                	jmp    c01005fd <stab_binsearch+0xf8>
        } else {
            // exact match for 'addr', but continue loop to find
            // *region_right
            *region_left = m;
c01005eb:	8b 45 0c             	mov    0xc(%ebp),%eax
c01005ee:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01005f1:	89 10                	mov    %edx,(%eax)
            l = m;
c01005f3:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01005f6:	89 45 fc             	mov    %eax,-0x4(%ebp)
            addr ++;
c01005f9:	83 45 18 01          	addl   $0x1,0x18(%ebp)
    while (l <= r) {
c01005fd:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100600:	3b 45 f8             	cmp    -0x8(%ebp),%eax
c0100603:	0f 8e 22 ff ff ff    	jle    c010052b <stab_binsearch+0x26>
        }
    }

    if (!any_matches) {
c0100609:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c010060d:	75 0f                	jne    c010061e <stab_binsearch+0x119>
        *region_right = *region_left - 1;
c010060f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100612:	8b 00                	mov    (%eax),%eax
c0100614:	8d 50 ff             	lea    -0x1(%eax),%edx
c0100617:	8b 45 10             	mov    0x10(%ebp),%eax
c010061a:	89 10                	mov    %edx,(%eax)
        l = *region_right;
        for (; l > *region_left && stabs[l].n_type != type; l --)
            /* do nothing */;
        *region_left = l;
    }
}
c010061c:	eb 3f                	jmp    c010065d <stab_binsearch+0x158>
        l = *region_right;
c010061e:	8b 45 10             	mov    0x10(%ebp),%eax
c0100621:	8b 00                	mov    (%eax),%eax
c0100623:	89 45 fc             	mov    %eax,-0x4(%ebp)
        for (; l > *region_left && stabs[l].n_type != type; l --)
c0100626:	eb 04                	jmp    c010062c <stab_binsearch+0x127>
c0100628:	83 6d fc 01          	subl   $0x1,-0x4(%ebp)
c010062c:	8b 45 0c             	mov    0xc(%ebp),%eax
c010062f:	8b 00                	mov    (%eax),%eax
c0100631:	39 45 fc             	cmp    %eax,-0x4(%ebp)
c0100634:	7e 1f                	jle    c0100655 <stab_binsearch+0x150>
c0100636:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0100639:	89 d0                	mov    %edx,%eax
c010063b:	01 c0                	add    %eax,%eax
c010063d:	01 d0                	add    %edx,%eax
c010063f:	c1 e0 02             	shl    $0x2,%eax
c0100642:	89 c2                	mov    %eax,%edx
c0100644:	8b 45 08             	mov    0x8(%ebp),%eax
c0100647:	01 d0                	add    %edx,%eax
c0100649:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c010064d:	0f b6 c0             	movzbl %al,%eax
c0100650:	39 45 14             	cmp    %eax,0x14(%ebp)
c0100653:	75 d3                	jne    c0100628 <stab_binsearch+0x123>
        *region_left = l;
c0100655:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100658:	8b 55 fc             	mov    -0x4(%ebp),%edx
c010065b:	89 10                	mov    %edx,(%eax)
}
c010065d:	90                   	nop
c010065e:	c9                   	leave  
c010065f:	c3                   	ret    

c0100660 <debuginfo_eip>:
 * the specified instruction address, @addr.  Returns 0 if information
 * was found, and negative if not.  But even if it returns negative it
 * has stored some information into '*info'.
 * */
int
debuginfo_eip(uintptr_t addr, struct eipdebuginfo *info) {
c0100660:	f3 0f 1e fb          	endbr32 
c0100664:	55                   	push   %ebp
c0100665:	89 e5                	mov    %esp,%ebp
c0100667:	83 ec 38             	sub    $0x38,%esp
    const struct stab *stabs, *stab_end;
    const char *stabstr, *stabstr_end;

    info->eip_file = "<unknown>";
c010066a:	8b 45 0c             	mov    0xc(%ebp),%eax
c010066d:	c7 00 74 85 10 c0    	movl   $0xc0108574,(%eax)
    info->eip_line = 0;
c0100673:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100676:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
    info->eip_fn_name = "<unknown>";
c010067d:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100680:	c7 40 08 74 85 10 c0 	movl   $0xc0108574,0x8(%eax)
    info->eip_fn_namelen = 9;
c0100687:	8b 45 0c             	mov    0xc(%ebp),%eax
c010068a:	c7 40 0c 09 00 00 00 	movl   $0x9,0xc(%eax)
    info->eip_fn_addr = addr;
c0100691:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100694:	8b 55 08             	mov    0x8(%ebp),%edx
c0100697:	89 50 10             	mov    %edx,0x10(%eax)
    info->eip_fn_narg = 0;
c010069a:	8b 45 0c             	mov    0xc(%ebp),%eax
c010069d:	c7 40 14 00 00 00 00 	movl   $0x0,0x14(%eax)

    stabs = __STAB_BEGIN__;
c01006a4:	c7 45 f4 e4 a5 10 c0 	movl   $0xc010a5e4,-0xc(%ebp)
    stab_end = __STAB_END__;
c01006ab:	c7 45 f0 90 bf 11 c0 	movl   $0xc011bf90,-0x10(%ebp)
    stabstr = __STABSTR_BEGIN__;
c01006b2:	c7 45 ec 91 bf 11 c0 	movl   $0xc011bf91,-0x14(%ebp)
    stabstr_end = __STABSTR_END__;
c01006b9:	c7 45 e8 83 f9 11 c0 	movl   $0xc011f983,-0x18(%ebp)

    // String table validity checks
    if (stabstr_end <= stabstr || stabstr_end[-1] != 0) {
c01006c0:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01006c3:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c01006c6:	76 0d                	jbe    c01006d5 <debuginfo_eip+0x75>
c01006c8:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01006cb:	83 e8 01             	sub    $0x1,%eax
c01006ce:	0f b6 00             	movzbl (%eax),%eax
c01006d1:	84 c0                	test   %al,%al
c01006d3:	74 0a                	je     c01006df <debuginfo_eip+0x7f>
        return -1;
c01006d5:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c01006da:	e9 85 02 00 00       	jmp    c0100964 <debuginfo_eip+0x304>
    // 'eip'.  First, we find the basic source file containing 'eip'.
    // Then, we look in that source file for the function.  Then we look
    // for the line number.

    // Search the entire set of stabs for the source file (type N_SO).
    int lfile = 0, rfile = (stab_end - stabs) - 1;
c01006df:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
c01006e6:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01006e9:	2b 45 f4             	sub    -0xc(%ebp),%eax
c01006ec:	c1 f8 02             	sar    $0x2,%eax
c01006ef:	69 c0 ab aa aa aa    	imul   $0xaaaaaaab,%eax,%eax
c01006f5:	83 e8 01             	sub    $0x1,%eax
c01006f8:	89 45 e0             	mov    %eax,-0x20(%ebp)
    stab_binsearch(stabs, &lfile, &rfile, N_SO, addr);
c01006fb:	ff 75 08             	pushl  0x8(%ebp)
c01006fe:	6a 64                	push   $0x64
c0100700:	8d 45 e0             	lea    -0x20(%ebp),%eax
c0100703:	50                   	push   %eax
c0100704:	8d 45 e4             	lea    -0x1c(%ebp),%eax
c0100707:	50                   	push   %eax
c0100708:	ff 75 f4             	pushl  -0xc(%ebp)
c010070b:	e8 f5 fd ff ff       	call   c0100505 <stab_binsearch>
c0100710:	83 c4 14             	add    $0x14,%esp
    if (lfile == 0)
c0100713:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100716:	85 c0                	test   %eax,%eax
c0100718:	75 0a                	jne    c0100724 <debuginfo_eip+0xc4>
        return -1;
c010071a:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c010071f:	e9 40 02 00 00       	jmp    c0100964 <debuginfo_eip+0x304>

    // Search within that file's stabs for the function definition
    // (N_FUN).
    int lfun = lfile, rfun = rfile;
c0100724:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100727:	89 45 dc             	mov    %eax,-0x24(%ebp)
c010072a:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010072d:	89 45 d8             	mov    %eax,-0x28(%ebp)
    int lline, rline;
    stab_binsearch(stabs, &lfun, &rfun, N_FUN, addr);
c0100730:	ff 75 08             	pushl  0x8(%ebp)
c0100733:	6a 24                	push   $0x24
c0100735:	8d 45 d8             	lea    -0x28(%ebp),%eax
c0100738:	50                   	push   %eax
c0100739:	8d 45 dc             	lea    -0x24(%ebp),%eax
c010073c:	50                   	push   %eax
c010073d:	ff 75 f4             	pushl  -0xc(%ebp)
c0100740:	e8 c0 fd ff ff       	call   c0100505 <stab_binsearch>
c0100745:	83 c4 14             	add    $0x14,%esp

    if (lfun <= rfun) {
c0100748:	8b 55 dc             	mov    -0x24(%ebp),%edx
c010074b:	8b 45 d8             	mov    -0x28(%ebp),%eax
c010074e:	39 c2                	cmp    %eax,%edx
c0100750:	7f 78                	jg     c01007ca <debuginfo_eip+0x16a>
        // stabs[lfun] points to the function name
        // in the string table, but check bounds just in case.
        if (stabs[lfun].n_strx < stabstr_end - stabstr) {
c0100752:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0100755:	89 c2                	mov    %eax,%edx
c0100757:	89 d0                	mov    %edx,%eax
c0100759:	01 c0                	add    %eax,%eax
c010075b:	01 d0                	add    %edx,%eax
c010075d:	c1 e0 02             	shl    $0x2,%eax
c0100760:	89 c2                	mov    %eax,%edx
c0100762:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100765:	01 d0                	add    %edx,%eax
c0100767:	8b 10                	mov    (%eax),%edx
c0100769:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010076c:	2b 45 ec             	sub    -0x14(%ebp),%eax
c010076f:	39 c2                	cmp    %eax,%edx
c0100771:	73 22                	jae    c0100795 <debuginfo_eip+0x135>
            info->eip_fn_name = stabstr + stabs[lfun].n_strx;
c0100773:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0100776:	89 c2                	mov    %eax,%edx
c0100778:	89 d0                	mov    %edx,%eax
c010077a:	01 c0                	add    %eax,%eax
c010077c:	01 d0                	add    %edx,%eax
c010077e:	c1 e0 02             	shl    $0x2,%eax
c0100781:	89 c2                	mov    %eax,%edx
c0100783:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100786:	01 d0                	add    %edx,%eax
c0100788:	8b 10                	mov    (%eax),%edx
c010078a:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010078d:	01 c2                	add    %eax,%edx
c010078f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100792:	89 50 08             	mov    %edx,0x8(%eax)
        }
        info->eip_fn_addr = stabs[lfun].n_value;
c0100795:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0100798:	89 c2                	mov    %eax,%edx
c010079a:	89 d0                	mov    %edx,%eax
c010079c:	01 c0                	add    %eax,%eax
c010079e:	01 d0                	add    %edx,%eax
c01007a0:	c1 e0 02             	shl    $0x2,%eax
c01007a3:	89 c2                	mov    %eax,%edx
c01007a5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01007a8:	01 d0                	add    %edx,%eax
c01007aa:	8b 50 08             	mov    0x8(%eax),%edx
c01007ad:	8b 45 0c             	mov    0xc(%ebp),%eax
c01007b0:	89 50 10             	mov    %edx,0x10(%eax)
        addr -= info->eip_fn_addr;
c01007b3:	8b 45 0c             	mov    0xc(%ebp),%eax
c01007b6:	8b 40 10             	mov    0x10(%eax),%eax
c01007b9:	29 45 08             	sub    %eax,0x8(%ebp)
        // Search within the function definition for the line number.
        lline = lfun;
c01007bc:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01007bf:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        rline = rfun;
c01007c2:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01007c5:	89 45 d0             	mov    %eax,-0x30(%ebp)
c01007c8:	eb 15                	jmp    c01007df <debuginfo_eip+0x17f>
    } else {
        // Couldn't find function stab!  Maybe we're in an assembly
        // file.  Search the whole file for the line number.
        info->eip_fn_addr = addr;
c01007ca:	8b 45 0c             	mov    0xc(%ebp),%eax
c01007cd:	8b 55 08             	mov    0x8(%ebp),%edx
c01007d0:	89 50 10             	mov    %edx,0x10(%eax)
        lline = lfile;
c01007d3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01007d6:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        rline = rfile;
c01007d9:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01007dc:	89 45 d0             	mov    %eax,-0x30(%ebp)
    }
    info->eip_fn_namelen = strfind(info->eip_fn_name, ':') - info->eip_fn_name;
c01007df:	8b 45 0c             	mov    0xc(%ebp),%eax
c01007e2:	8b 40 08             	mov    0x8(%eax),%eax
c01007e5:	83 ec 08             	sub    $0x8,%esp
c01007e8:	6a 3a                	push   $0x3a
c01007ea:	50                   	push   %eax
c01007eb:	e8 4d 72 00 00       	call   c0107a3d <strfind>
c01007f0:	83 c4 10             	add    $0x10,%esp
c01007f3:	8b 55 0c             	mov    0xc(%ebp),%edx
c01007f6:	8b 52 08             	mov    0x8(%edx),%edx
c01007f9:	29 d0                	sub    %edx,%eax
c01007fb:	89 c2                	mov    %eax,%edx
c01007fd:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100800:	89 50 0c             	mov    %edx,0xc(%eax)

    // Search within [lline, rline] for the line number stab.
    // If found, set info->eip_line to the right line number.
    // If not found, return -1.
    stab_binsearch(stabs, &lline, &rline, N_SLINE, addr);
c0100803:	83 ec 0c             	sub    $0xc,%esp
c0100806:	ff 75 08             	pushl  0x8(%ebp)
c0100809:	6a 44                	push   $0x44
c010080b:	8d 45 d0             	lea    -0x30(%ebp),%eax
c010080e:	50                   	push   %eax
c010080f:	8d 45 d4             	lea    -0x2c(%ebp),%eax
c0100812:	50                   	push   %eax
c0100813:	ff 75 f4             	pushl  -0xc(%ebp)
c0100816:	e8 ea fc ff ff       	call   c0100505 <stab_binsearch>
c010081b:	83 c4 20             	add    $0x20,%esp
    if (lline <= rline) {
c010081e:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0100821:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0100824:	39 c2                	cmp    %eax,%edx
c0100826:	7f 24                	jg     c010084c <debuginfo_eip+0x1ec>
        info->eip_line = stabs[rline].n_desc;
c0100828:	8b 45 d0             	mov    -0x30(%ebp),%eax
c010082b:	89 c2                	mov    %eax,%edx
c010082d:	89 d0                	mov    %edx,%eax
c010082f:	01 c0                	add    %eax,%eax
c0100831:	01 d0                	add    %edx,%eax
c0100833:	c1 e0 02             	shl    $0x2,%eax
c0100836:	89 c2                	mov    %eax,%edx
c0100838:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010083b:	01 d0                	add    %edx,%eax
c010083d:	0f b7 40 06          	movzwl 0x6(%eax),%eax
c0100841:	0f b7 d0             	movzwl %ax,%edx
c0100844:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100847:	89 50 04             	mov    %edx,0x4(%eax)

    // Search backwards from the line number for the relevant filename stab.
    // We can't just use the "lfile" stab because inlined functions
    // can interpolate code from a different file!
    // Such included source files use the N_SOL stab type.
    while (lline >= lfile
c010084a:	eb 13                	jmp    c010085f <debuginfo_eip+0x1ff>
        return -1;
c010084c:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0100851:	e9 0e 01 00 00       	jmp    c0100964 <debuginfo_eip+0x304>
           && stabs[lline].n_type != N_SOL
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
        lline --;
c0100856:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100859:	83 e8 01             	sub    $0x1,%eax
c010085c:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    while (lline >= lfile
c010085f:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0100862:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100865:	39 c2                	cmp    %eax,%edx
c0100867:	7c 56                	jl     c01008bf <debuginfo_eip+0x25f>
           && stabs[lline].n_type != N_SOL
c0100869:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c010086c:	89 c2                	mov    %eax,%edx
c010086e:	89 d0                	mov    %edx,%eax
c0100870:	01 c0                	add    %eax,%eax
c0100872:	01 d0                	add    %edx,%eax
c0100874:	c1 e0 02             	shl    $0x2,%eax
c0100877:	89 c2                	mov    %eax,%edx
c0100879:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010087c:	01 d0                	add    %edx,%eax
c010087e:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c0100882:	3c 84                	cmp    $0x84,%al
c0100884:	74 39                	je     c01008bf <debuginfo_eip+0x25f>
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
c0100886:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100889:	89 c2                	mov    %eax,%edx
c010088b:	89 d0                	mov    %edx,%eax
c010088d:	01 c0                	add    %eax,%eax
c010088f:	01 d0                	add    %edx,%eax
c0100891:	c1 e0 02             	shl    $0x2,%eax
c0100894:	89 c2                	mov    %eax,%edx
c0100896:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100899:	01 d0                	add    %edx,%eax
c010089b:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c010089f:	3c 64                	cmp    $0x64,%al
c01008a1:	75 b3                	jne    c0100856 <debuginfo_eip+0x1f6>
c01008a3:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01008a6:	89 c2                	mov    %eax,%edx
c01008a8:	89 d0                	mov    %edx,%eax
c01008aa:	01 c0                	add    %eax,%eax
c01008ac:	01 d0                	add    %edx,%eax
c01008ae:	c1 e0 02             	shl    $0x2,%eax
c01008b1:	89 c2                	mov    %eax,%edx
c01008b3:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01008b6:	01 d0                	add    %edx,%eax
c01008b8:	8b 40 08             	mov    0x8(%eax),%eax
c01008bb:	85 c0                	test   %eax,%eax
c01008bd:	74 97                	je     c0100856 <debuginfo_eip+0x1f6>
    }
    if (lline >= lfile && stabs[lline].n_strx < stabstr_end - stabstr) {
c01008bf:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01008c2:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01008c5:	39 c2                	cmp    %eax,%edx
c01008c7:	7c 42                	jl     c010090b <debuginfo_eip+0x2ab>
c01008c9:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01008cc:	89 c2                	mov    %eax,%edx
c01008ce:	89 d0                	mov    %edx,%eax
c01008d0:	01 c0                	add    %eax,%eax
c01008d2:	01 d0                	add    %edx,%eax
c01008d4:	c1 e0 02             	shl    $0x2,%eax
c01008d7:	89 c2                	mov    %eax,%edx
c01008d9:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01008dc:	01 d0                	add    %edx,%eax
c01008de:	8b 10                	mov    (%eax),%edx
c01008e0:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01008e3:	2b 45 ec             	sub    -0x14(%ebp),%eax
c01008e6:	39 c2                	cmp    %eax,%edx
c01008e8:	73 21                	jae    c010090b <debuginfo_eip+0x2ab>
        info->eip_file = stabstr + stabs[lline].n_strx;
c01008ea:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01008ed:	89 c2                	mov    %eax,%edx
c01008ef:	89 d0                	mov    %edx,%eax
c01008f1:	01 c0                	add    %eax,%eax
c01008f3:	01 d0                	add    %edx,%eax
c01008f5:	c1 e0 02             	shl    $0x2,%eax
c01008f8:	89 c2                	mov    %eax,%edx
c01008fa:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01008fd:	01 d0                	add    %edx,%eax
c01008ff:	8b 10                	mov    (%eax),%edx
c0100901:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100904:	01 c2                	add    %eax,%edx
c0100906:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100909:	89 10                	mov    %edx,(%eax)
    }

    // Set eip_fn_narg to the number of arguments taken by the function,
    // or 0 if there was no containing function.
    if (lfun < rfun) {
c010090b:	8b 55 dc             	mov    -0x24(%ebp),%edx
c010090e:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0100911:	39 c2                	cmp    %eax,%edx
c0100913:	7d 4a                	jge    c010095f <debuginfo_eip+0x2ff>
        for (lline = lfun + 1;
c0100915:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0100918:	83 c0 01             	add    $0x1,%eax
c010091b:	89 45 d4             	mov    %eax,-0x2c(%ebp)
c010091e:	eb 18                	jmp    c0100938 <debuginfo_eip+0x2d8>
             lline < rfun && stabs[lline].n_type == N_PSYM;
             lline ++) {
            info->eip_fn_narg ++;
c0100920:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100923:	8b 40 14             	mov    0x14(%eax),%eax
c0100926:	8d 50 01             	lea    0x1(%eax),%edx
c0100929:	8b 45 0c             	mov    0xc(%ebp),%eax
c010092c:	89 50 14             	mov    %edx,0x14(%eax)
             lline ++) {
c010092f:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100932:	83 c0 01             	add    $0x1,%eax
c0100935:	89 45 d4             	mov    %eax,-0x2c(%ebp)
             lline < rfun && stabs[lline].n_type == N_PSYM;
c0100938:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c010093b:	8b 45 d8             	mov    -0x28(%ebp),%eax
        for (lline = lfun + 1;
c010093e:	39 c2                	cmp    %eax,%edx
c0100940:	7d 1d                	jge    c010095f <debuginfo_eip+0x2ff>
             lline < rfun && stabs[lline].n_type == N_PSYM;
c0100942:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100945:	89 c2                	mov    %eax,%edx
c0100947:	89 d0                	mov    %edx,%eax
c0100949:	01 c0                	add    %eax,%eax
c010094b:	01 d0                	add    %edx,%eax
c010094d:	c1 e0 02             	shl    $0x2,%eax
c0100950:	89 c2                	mov    %eax,%edx
c0100952:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100955:	01 d0                	add    %edx,%eax
c0100957:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c010095b:	3c a0                	cmp    $0xa0,%al
c010095d:	74 c1                	je     c0100920 <debuginfo_eip+0x2c0>
        }
    }
    return 0;
c010095f:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100964:	c9                   	leave  
c0100965:	c3                   	ret    

c0100966 <print_kerninfo>:
 * print_kerninfo - print the information about kernel, including the location
 * of kernel entry, the start addresses of data and text segements, the start
 * address of free memory and how many memory that kernel has used.
 * */
void
print_kerninfo(void) {
c0100966:	f3 0f 1e fb          	endbr32 
c010096a:	55                   	push   %ebp
c010096b:	89 e5                	mov    %esp,%ebp
c010096d:	83 ec 08             	sub    $0x8,%esp
    extern char etext[], edata[], end[], kern_init[];
    cprintf("Special kernel symbols:\n");
c0100970:	83 ec 0c             	sub    $0xc,%esp
c0100973:	68 7e 85 10 c0       	push   $0xc010857e
c0100978:	e8 2d f9 ff ff       	call   c01002aa <cprintf>
c010097d:	83 c4 10             	add    $0x10,%esp
    cprintf("  entry  0x%08x (phys)\n", kern_init);
c0100980:	83 ec 08             	sub    $0x8,%esp
c0100983:	68 36 00 10 c0       	push   $0xc0100036
c0100988:	68 97 85 10 c0       	push   $0xc0108597
c010098d:	e8 18 f9 ff ff       	call   c01002aa <cprintf>
c0100992:	83 c4 10             	add    $0x10,%esp
    cprintf("  etext  0x%08x (phys)\n", etext);
c0100995:	83 ec 08             	sub    $0x8,%esp
c0100998:	68 72 84 10 c0       	push   $0xc0108472
c010099d:	68 af 85 10 c0       	push   $0xc01085af
c01009a2:	e8 03 f9 ff ff       	call   c01002aa <cprintf>
c01009a7:	83 c4 10             	add    $0x10,%esp
    cprintf("  edata  0x%08x (phys)\n", edata);
c01009aa:	83 ec 08             	sub    $0x8,%esp
c01009ad:	68 00 50 12 c0       	push   $0xc0125000
c01009b2:	68 c7 85 10 c0       	push   $0xc01085c7
c01009b7:	e8 ee f8 ff ff       	call   c01002aa <cprintf>
c01009bc:	83 c4 10             	add    $0x10,%esp
    cprintf("  end    0x%08x (phys)\n", end);
c01009bf:	83 ec 08             	sub    $0x8,%esp
c01009c2:	68 fc 60 12 c0       	push   $0xc01260fc
c01009c7:	68 df 85 10 c0       	push   $0xc01085df
c01009cc:	e8 d9 f8 ff ff       	call   c01002aa <cprintf>
c01009d1:	83 c4 10             	add    $0x10,%esp
    cprintf("Kernel executable memory footprint: %dKB\n", (end - kern_init + 1023)/1024);
c01009d4:	b8 fc 60 12 c0       	mov    $0xc01260fc,%eax
c01009d9:	2d 36 00 10 c0       	sub    $0xc0100036,%eax
c01009de:	05 ff 03 00 00       	add    $0x3ff,%eax
c01009e3:	8d 90 ff 03 00 00    	lea    0x3ff(%eax),%edx
c01009e9:	85 c0                	test   %eax,%eax
c01009eb:	0f 48 c2             	cmovs  %edx,%eax
c01009ee:	c1 f8 0a             	sar    $0xa,%eax
c01009f1:	83 ec 08             	sub    $0x8,%esp
c01009f4:	50                   	push   %eax
c01009f5:	68 f8 85 10 c0       	push   $0xc01085f8
c01009fa:	e8 ab f8 ff ff       	call   c01002aa <cprintf>
c01009ff:	83 c4 10             	add    $0x10,%esp
}
c0100a02:	90                   	nop
c0100a03:	c9                   	leave  
c0100a04:	c3                   	ret    

c0100a05 <print_debuginfo>:
/* *
 * print_debuginfo - read and print the stat information for the address @eip,
 * and info.eip_fn_addr should be the first address of the related function.
 * */
void
print_debuginfo(uintptr_t eip) {
c0100a05:	f3 0f 1e fb          	endbr32 
c0100a09:	55                   	push   %ebp
c0100a0a:	89 e5                	mov    %esp,%ebp
c0100a0c:	81 ec 28 01 00 00    	sub    $0x128,%esp
    struct eipdebuginfo info;
    if (debuginfo_eip(eip, &info) != 0) {
c0100a12:	83 ec 08             	sub    $0x8,%esp
c0100a15:	8d 45 dc             	lea    -0x24(%ebp),%eax
c0100a18:	50                   	push   %eax
c0100a19:	ff 75 08             	pushl  0x8(%ebp)
c0100a1c:	e8 3f fc ff ff       	call   c0100660 <debuginfo_eip>
c0100a21:	83 c4 10             	add    $0x10,%esp
c0100a24:	85 c0                	test   %eax,%eax
c0100a26:	74 15                	je     c0100a3d <print_debuginfo+0x38>
        cprintf("    <unknow>: -- 0x%08x --\n", eip);
c0100a28:	83 ec 08             	sub    $0x8,%esp
c0100a2b:	ff 75 08             	pushl  0x8(%ebp)
c0100a2e:	68 22 86 10 c0       	push   $0xc0108622
c0100a33:	e8 72 f8 ff ff       	call   c01002aa <cprintf>
c0100a38:	83 c4 10             	add    $0x10,%esp
        }
        fnname[j] = '\0';
        cprintf("    %s:%d: %s+%d\n", info.eip_file, info.eip_line,
                fnname, eip - info.eip_fn_addr);
    }
}
c0100a3b:	eb 65                	jmp    c0100aa2 <print_debuginfo+0x9d>
        for (j = 0; j < info.eip_fn_namelen; j ++) {
c0100a3d:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0100a44:	eb 1c                	jmp    c0100a62 <print_debuginfo+0x5d>
            fnname[j] = info.eip_fn_name[j];
c0100a46:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0100a49:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a4c:	01 d0                	add    %edx,%eax
c0100a4e:	0f b6 00             	movzbl (%eax),%eax
c0100a51:	8d 8d dc fe ff ff    	lea    -0x124(%ebp),%ecx
c0100a57:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0100a5a:	01 ca                	add    %ecx,%edx
c0100a5c:	88 02                	mov    %al,(%edx)
        for (j = 0; j < info.eip_fn_namelen; j ++) {
c0100a5e:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c0100a62:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100a65:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0100a68:	7c dc                	jl     c0100a46 <print_debuginfo+0x41>
        fnname[j] = '\0';
c0100a6a:	8d 95 dc fe ff ff    	lea    -0x124(%ebp),%edx
c0100a70:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a73:	01 d0                	add    %edx,%eax
c0100a75:	c6 00 00             	movb   $0x0,(%eax)
                fnname, eip - info.eip_fn_addr);
c0100a78:	8b 45 ec             	mov    -0x14(%ebp),%eax
        cprintf("    %s:%d: %s+%d\n", info.eip_file, info.eip_line,
c0100a7b:	8b 55 08             	mov    0x8(%ebp),%edx
c0100a7e:	89 d1                	mov    %edx,%ecx
c0100a80:	29 c1                	sub    %eax,%ecx
c0100a82:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0100a85:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0100a88:	83 ec 0c             	sub    $0xc,%esp
c0100a8b:	51                   	push   %ecx
c0100a8c:	8d 8d dc fe ff ff    	lea    -0x124(%ebp),%ecx
c0100a92:	51                   	push   %ecx
c0100a93:	52                   	push   %edx
c0100a94:	50                   	push   %eax
c0100a95:	68 3e 86 10 c0       	push   $0xc010863e
c0100a9a:	e8 0b f8 ff ff       	call   c01002aa <cprintf>
c0100a9f:	83 c4 20             	add    $0x20,%esp
}
c0100aa2:	90                   	nop
c0100aa3:	c9                   	leave  
c0100aa4:	c3                   	ret    

c0100aa5 <read_eip>:

static __noinline uint32_t
read_eip(void) {
c0100aa5:	f3 0f 1e fb          	endbr32 
c0100aa9:	55                   	push   %ebp
c0100aaa:	89 e5                	mov    %esp,%ebp
c0100aac:	83 ec 10             	sub    $0x10,%esp
    uint32_t eip;
    asm volatile("movl 4(%%ebp), %0" : "=r" (eip));
c0100aaf:	8b 45 04             	mov    0x4(%ebp),%eax
c0100ab2:	89 45 fc             	mov    %eax,-0x4(%ebp)
    return eip;
c0100ab5:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c0100ab8:	c9                   	leave  
c0100ab9:	c3                   	ret    

c0100aba <print_stackframe>:
 *
 * Note that, the length of ebp-chain is limited. In boot/bootasm.S, before jumping
 * to the kernel entry, the value of ebp has been set to zero, that's the boundary.
 * */
void
print_stackframe(void) {
c0100aba:	f3 0f 1e fb          	endbr32 
c0100abe:	55                   	push   %ebp
c0100abf:	89 e5                	mov    %esp,%ebp
c0100ac1:	83 ec 28             	sub    $0x28,%esp
}

static inline uint32_t
read_ebp(void) {
    uint32_t ebp;
    asm volatile ("movl %%ebp, %0" : "=r" (ebp));
c0100ac4:	89 e8                	mov    %ebp,%eax
c0100ac6:	89 45 d8             	mov    %eax,-0x28(%ebp)
    return ebp;
c0100ac9:	8b 45 d8             	mov    -0x28(%ebp),%eax
      */
     // EBP指针指向当前堆栈轨迹，通过EBP形成了一个调用链，沿着调用链可以找出函数调用轨迹。
     // 注意指针运算时候的单位问题,例如一个int*类型的指针+1其实质地址值+4
     // 注意取得EBP EIP值的顺序问题
     
    uint32_t ebp_value = read_ebp();
c0100acc:	89 45 f4             	mov    %eax,-0xc(%ebp)
    uint32_t eip_value = read_eip();
c0100acf:	e8 d1 ff ff ff       	call   c0100aa5 <read_eip>
c0100ad4:	89 45 f0             	mov    %eax,-0x10(%ebp)

    while(ebp_value != 0){
c0100ad7:	e9 c1 00 00 00       	jmp    c0100b9d <print_stackframe+0xe3>
        cprintf("ebp: %x, eip:%x ", ebp_value, (eip_value < 0x10000) ? (eip_value - 2) : (eip_value - 5));
c0100adc:	81 7d f0 ff ff 00 00 	cmpl   $0xffff,-0x10(%ebp)
c0100ae3:	77 08                	ja     c0100aed <print_stackframe+0x33>
c0100ae5:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100ae8:	83 e8 02             	sub    $0x2,%eax
c0100aeb:	eb 06                	jmp    c0100af3 <print_stackframe+0x39>
c0100aed:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100af0:	83 e8 05             	sub    $0x5,%eax
c0100af3:	83 ec 04             	sub    $0x4,%esp
c0100af6:	50                   	push   %eax
c0100af7:	ff 75 f4             	pushl  -0xc(%ebp)
c0100afa:	68 50 86 10 c0       	push   $0xc0108650
c0100aff:	e8 a6 f7 ff ff       	call   c01002aa <cprintf>
c0100b04:	83 c4 10             	add    $0x10,%esp

        uint32_t* cur_stack = (uint32_t*) ebp_value;
c0100b07:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100b0a:	89 45 ec             	mov    %eax,-0x14(%ebp)
        uint32_t arg1, arg2, arg3, arg4;
        arg1 = cur_stack[2];
c0100b0d:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100b10:	8b 40 08             	mov    0x8(%eax),%eax
c0100b13:	89 45 e8             	mov    %eax,-0x18(%ebp)
        arg2 = cur_stack[3];
c0100b16:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100b19:	8b 40 0c             	mov    0xc(%eax),%eax
c0100b1c:	89 45 e4             	mov    %eax,-0x1c(%ebp)
        arg3 = cur_stack[4];
c0100b1f:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100b22:	8b 40 10             	mov    0x10(%eax),%eax
c0100b25:	89 45 e0             	mov    %eax,-0x20(%ebp)
        arg4 = cur_stack[5];
c0100b28:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100b2b:	8b 40 14             	mov    0x14(%eax),%eax
c0100b2e:	89 45 dc             	mov    %eax,-0x24(%ebp)
        cprintf("args: %x, %x, %x, %x ",arg1, arg2, arg3, arg4);
c0100b31:	83 ec 0c             	sub    $0xc,%esp
c0100b34:	ff 75 dc             	pushl  -0x24(%ebp)
c0100b37:	ff 75 e0             	pushl  -0x20(%ebp)
c0100b3a:	ff 75 e4             	pushl  -0x1c(%ebp)
c0100b3d:	ff 75 e8             	pushl  -0x18(%ebp)
c0100b40:	68 61 86 10 c0       	push   $0xc0108661
c0100b45:	e8 60 f7 ff ff       	call   c01002aa <cprintf>
c0100b4a:	83 c4 20             	add    $0x20,%esp

        cprintf("\n");
c0100b4d:	83 ec 0c             	sub    $0xc,%esp
c0100b50:	68 77 86 10 c0       	push   $0xc0108677
c0100b55:	e8 50 f7 ff ff       	call   c01002aa <cprintf>
c0100b5a:	83 c4 10             	add    $0x10,%esp

        if(eip_value < 0x10000){
c0100b5d:	81 7d f0 ff ff 00 00 	cmpl   $0xffff,-0x10(%ebp)
c0100b64:	77 14                	ja     c0100b7a <print_stackframe+0xc0>
            print_debuginfo(eip_value - 2);
c0100b66:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100b69:	83 e8 02             	sub    $0x2,%eax
c0100b6c:	83 ec 0c             	sub    $0xc,%esp
c0100b6f:	50                   	push   %eax
c0100b70:	e8 90 fe ff ff       	call   c0100a05 <print_debuginfo>
c0100b75:	83 c4 10             	add    $0x10,%esp
c0100b78:	eb 12                	jmp    c0100b8c <print_stackframe+0xd2>
        } else {
            print_debuginfo(eip_value - 5);
c0100b7a:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100b7d:	83 e8 05             	sub    $0x5,%eax
c0100b80:	83 ec 0c             	sub    $0xc,%esp
c0100b83:	50                   	push   %eax
c0100b84:	e8 7c fe ff ff       	call   c0100a05 <print_debuginfo>
c0100b89:	83 c4 10             	add    $0x10,%esp
        }

        ebp_value = cur_stack[0];
c0100b8c:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100b8f:	8b 00                	mov    (%eax),%eax
c0100b91:	89 45 f4             	mov    %eax,-0xc(%ebp)
        eip_value = cur_stack[1];
c0100b94:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100b97:	8b 40 04             	mov    0x4(%eax),%eax
c0100b9a:	89 45 f0             	mov    %eax,-0x10(%ebp)
    while(ebp_value != 0){
c0100b9d:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0100ba1:	0f 85 35 ff ff ff    	jne    c0100adc <print_stackframe+0x22>
    }
}
c0100ba7:	90                   	nop
c0100ba8:	90                   	nop
c0100ba9:	c9                   	leave  
c0100baa:	c3                   	ret    

c0100bab <parse>:
#define MAXARGS         16
#define WHITESPACE      " \t\n\r"

/* parse - parse the command buffer into whitespace-separated arguments */
static int
parse(char *buf, char **argv) {
c0100bab:	f3 0f 1e fb          	endbr32 
c0100baf:	55                   	push   %ebp
c0100bb0:	89 e5                	mov    %esp,%ebp
c0100bb2:	83 ec 18             	sub    $0x18,%esp
    int argc = 0;
c0100bb5:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    while (1) {
        // find global whitespace
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
c0100bbc:	eb 0c                	jmp    c0100bca <parse+0x1f>
            *buf ++ = '\0';
c0100bbe:	8b 45 08             	mov    0x8(%ebp),%eax
c0100bc1:	8d 50 01             	lea    0x1(%eax),%edx
c0100bc4:	89 55 08             	mov    %edx,0x8(%ebp)
c0100bc7:	c6 00 00             	movb   $0x0,(%eax)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
c0100bca:	8b 45 08             	mov    0x8(%ebp),%eax
c0100bcd:	0f b6 00             	movzbl (%eax),%eax
c0100bd0:	84 c0                	test   %al,%al
c0100bd2:	74 1e                	je     c0100bf2 <parse+0x47>
c0100bd4:	8b 45 08             	mov    0x8(%ebp),%eax
c0100bd7:	0f b6 00             	movzbl (%eax),%eax
c0100bda:	0f be c0             	movsbl %al,%eax
c0100bdd:	83 ec 08             	sub    $0x8,%esp
c0100be0:	50                   	push   %eax
c0100be1:	68 fc 86 10 c0       	push   $0xc01086fc
c0100be6:	e8 1b 6e 00 00       	call   c0107a06 <strchr>
c0100beb:	83 c4 10             	add    $0x10,%esp
c0100bee:	85 c0                	test   %eax,%eax
c0100bf0:	75 cc                	jne    c0100bbe <parse+0x13>
        }
        if (*buf == '\0') {
c0100bf2:	8b 45 08             	mov    0x8(%ebp),%eax
c0100bf5:	0f b6 00             	movzbl (%eax),%eax
c0100bf8:	84 c0                	test   %al,%al
c0100bfa:	74 65                	je     c0100c61 <parse+0xb6>
            break;
        }

        // save and scan past next arg
        if (argc == MAXARGS - 1) {
c0100bfc:	83 7d f4 0f          	cmpl   $0xf,-0xc(%ebp)
c0100c00:	75 12                	jne    c0100c14 <parse+0x69>
            cprintf("Too many arguments (max %d).\n", MAXARGS);
c0100c02:	83 ec 08             	sub    $0x8,%esp
c0100c05:	6a 10                	push   $0x10
c0100c07:	68 01 87 10 c0       	push   $0xc0108701
c0100c0c:	e8 99 f6 ff ff       	call   c01002aa <cprintf>
c0100c11:	83 c4 10             	add    $0x10,%esp
        }
        argv[argc ++] = buf;
c0100c14:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100c17:	8d 50 01             	lea    0x1(%eax),%edx
c0100c1a:	89 55 f4             	mov    %edx,-0xc(%ebp)
c0100c1d:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c0100c24:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100c27:	01 c2                	add    %eax,%edx
c0100c29:	8b 45 08             	mov    0x8(%ebp),%eax
c0100c2c:	89 02                	mov    %eax,(%edx)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
c0100c2e:	eb 04                	jmp    c0100c34 <parse+0x89>
            buf ++;
c0100c30:	83 45 08 01          	addl   $0x1,0x8(%ebp)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
c0100c34:	8b 45 08             	mov    0x8(%ebp),%eax
c0100c37:	0f b6 00             	movzbl (%eax),%eax
c0100c3a:	84 c0                	test   %al,%al
c0100c3c:	74 8c                	je     c0100bca <parse+0x1f>
c0100c3e:	8b 45 08             	mov    0x8(%ebp),%eax
c0100c41:	0f b6 00             	movzbl (%eax),%eax
c0100c44:	0f be c0             	movsbl %al,%eax
c0100c47:	83 ec 08             	sub    $0x8,%esp
c0100c4a:	50                   	push   %eax
c0100c4b:	68 fc 86 10 c0       	push   $0xc01086fc
c0100c50:	e8 b1 6d 00 00       	call   c0107a06 <strchr>
c0100c55:	83 c4 10             	add    $0x10,%esp
c0100c58:	85 c0                	test   %eax,%eax
c0100c5a:	74 d4                	je     c0100c30 <parse+0x85>
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
c0100c5c:	e9 69 ff ff ff       	jmp    c0100bca <parse+0x1f>
            break;
c0100c61:	90                   	nop
        }
    }
    return argc;
c0100c62:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0100c65:	c9                   	leave  
c0100c66:	c3                   	ret    

c0100c67 <runcmd>:
/* *
 * runcmd - parse the input string, split it into separated arguments
 * and then lookup and invoke some related commands/
 * */
static int
runcmd(char *buf, struct trapframe *tf) {
c0100c67:	f3 0f 1e fb          	endbr32 
c0100c6b:	55                   	push   %ebp
c0100c6c:	89 e5                	mov    %esp,%ebp
c0100c6e:	83 ec 58             	sub    $0x58,%esp
    char *argv[MAXARGS];
    int argc = parse(buf, argv);
c0100c71:	83 ec 08             	sub    $0x8,%esp
c0100c74:	8d 45 b0             	lea    -0x50(%ebp),%eax
c0100c77:	50                   	push   %eax
c0100c78:	ff 75 08             	pushl  0x8(%ebp)
c0100c7b:	e8 2b ff ff ff       	call   c0100bab <parse>
c0100c80:	83 c4 10             	add    $0x10,%esp
c0100c83:	89 45 f0             	mov    %eax,-0x10(%ebp)
    if (argc == 0) {
c0100c86:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0100c8a:	75 0a                	jne    c0100c96 <runcmd+0x2f>
        return 0;
c0100c8c:	b8 00 00 00 00       	mov    $0x0,%eax
c0100c91:	e9 83 00 00 00       	jmp    c0100d19 <runcmd+0xb2>
    }
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
c0100c96:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0100c9d:	eb 59                	jmp    c0100cf8 <runcmd+0x91>
        if (strcmp(commands[i].name, argv[0]) == 0) {
c0100c9f:	8b 4d b0             	mov    -0x50(%ebp),%ecx
c0100ca2:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0100ca5:	89 d0                	mov    %edx,%eax
c0100ca7:	01 c0                	add    %eax,%eax
c0100ca9:	01 d0                	add    %edx,%eax
c0100cab:	c1 e0 02             	shl    $0x2,%eax
c0100cae:	05 00 20 12 c0       	add    $0xc0122000,%eax
c0100cb3:	8b 00                	mov    (%eax),%eax
c0100cb5:	83 ec 08             	sub    $0x8,%esp
c0100cb8:	51                   	push   %ecx
c0100cb9:	50                   	push   %eax
c0100cba:	e8 a0 6c 00 00       	call   c010795f <strcmp>
c0100cbf:	83 c4 10             	add    $0x10,%esp
c0100cc2:	85 c0                	test   %eax,%eax
c0100cc4:	75 2e                	jne    c0100cf4 <runcmd+0x8d>
            return commands[i].func(argc - 1, argv + 1, tf);
c0100cc6:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0100cc9:	89 d0                	mov    %edx,%eax
c0100ccb:	01 c0                	add    %eax,%eax
c0100ccd:	01 d0                	add    %edx,%eax
c0100ccf:	c1 e0 02             	shl    $0x2,%eax
c0100cd2:	05 08 20 12 c0       	add    $0xc0122008,%eax
c0100cd7:	8b 10                	mov    (%eax),%edx
c0100cd9:	8d 45 b0             	lea    -0x50(%ebp),%eax
c0100cdc:	83 c0 04             	add    $0x4,%eax
c0100cdf:	8b 4d f0             	mov    -0x10(%ebp),%ecx
c0100ce2:	83 e9 01             	sub    $0x1,%ecx
c0100ce5:	83 ec 04             	sub    $0x4,%esp
c0100ce8:	ff 75 0c             	pushl  0xc(%ebp)
c0100ceb:	50                   	push   %eax
c0100cec:	51                   	push   %ecx
c0100ced:	ff d2                	call   *%edx
c0100cef:	83 c4 10             	add    $0x10,%esp
c0100cf2:	eb 25                	jmp    c0100d19 <runcmd+0xb2>
    for (i = 0; i < NCOMMANDS; i ++) {
c0100cf4:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c0100cf8:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100cfb:	83 f8 02             	cmp    $0x2,%eax
c0100cfe:	76 9f                	jbe    c0100c9f <runcmd+0x38>
        }
    }
    cprintf("Unknown command '%s'\n", argv[0]);
c0100d00:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0100d03:	83 ec 08             	sub    $0x8,%esp
c0100d06:	50                   	push   %eax
c0100d07:	68 1f 87 10 c0       	push   $0xc010871f
c0100d0c:	e8 99 f5 ff ff       	call   c01002aa <cprintf>
c0100d11:	83 c4 10             	add    $0x10,%esp
    return 0;
c0100d14:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100d19:	c9                   	leave  
c0100d1a:	c3                   	ret    

c0100d1b <kmonitor>:

/***** Implementations of basic kernel monitor commands *****/

void
kmonitor(struct trapframe *tf) {
c0100d1b:	f3 0f 1e fb          	endbr32 
c0100d1f:	55                   	push   %ebp
c0100d20:	89 e5                	mov    %esp,%ebp
c0100d22:	83 ec 18             	sub    $0x18,%esp
    cprintf("Welcome to the kernel debug monitor!!\n");
c0100d25:	83 ec 0c             	sub    $0xc,%esp
c0100d28:	68 38 87 10 c0       	push   $0xc0108738
c0100d2d:	e8 78 f5 ff ff       	call   c01002aa <cprintf>
c0100d32:	83 c4 10             	add    $0x10,%esp
    cprintf("Type 'help' for a list of commands.\n");
c0100d35:	83 ec 0c             	sub    $0xc,%esp
c0100d38:	68 60 87 10 c0       	push   $0xc0108760
c0100d3d:	e8 68 f5 ff ff       	call   c01002aa <cprintf>
c0100d42:	83 c4 10             	add    $0x10,%esp

    if (tf != NULL) {
c0100d45:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0100d49:	74 0e                	je     c0100d59 <kmonitor+0x3e>
        print_trapframe(tf);
c0100d4b:	83 ec 0c             	sub    $0xc,%esp
c0100d4e:	ff 75 08             	pushl  0x8(%ebp)
c0100d51:	e8 a6 15 00 00       	call   c01022fc <print_trapframe>
c0100d56:	83 c4 10             	add    $0x10,%esp
    }

    char *buf;
    while (1) {
        if ((buf = readline("K> ")) != NULL) {
c0100d59:	83 ec 0c             	sub    $0xc,%esp
c0100d5c:	68 85 87 10 c0       	push   $0xc0108785
c0100d61:	e8 f9 f5 ff ff       	call   c010035f <readline>
c0100d66:	83 c4 10             	add    $0x10,%esp
c0100d69:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0100d6c:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0100d70:	74 e7                	je     c0100d59 <kmonitor+0x3e>
            if (runcmd(buf, tf) < 0) {
c0100d72:	83 ec 08             	sub    $0x8,%esp
c0100d75:	ff 75 08             	pushl  0x8(%ebp)
c0100d78:	ff 75 f4             	pushl  -0xc(%ebp)
c0100d7b:	e8 e7 fe ff ff       	call   c0100c67 <runcmd>
c0100d80:	83 c4 10             	add    $0x10,%esp
c0100d83:	85 c0                	test   %eax,%eax
c0100d85:	78 02                	js     c0100d89 <kmonitor+0x6e>
        if ((buf = readline("K> ")) != NULL) {
c0100d87:	eb d0                	jmp    c0100d59 <kmonitor+0x3e>
                break;
c0100d89:	90                   	nop
            }
        }
    }
}
c0100d8a:	90                   	nop
c0100d8b:	c9                   	leave  
c0100d8c:	c3                   	ret    

c0100d8d <mon_help>:

/* mon_help - print the information about mon_* functions */
int
mon_help(int argc, char **argv, struct trapframe *tf) {
c0100d8d:	f3 0f 1e fb          	endbr32 
c0100d91:	55                   	push   %ebp
c0100d92:	89 e5                	mov    %esp,%ebp
c0100d94:	83 ec 18             	sub    $0x18,%esp
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
c0100d97:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0100d9e:	eb 3c                	jmp    c0100ddc <mon_help+0x4f>
        cprintf("%s - %s\n", commands[i].name, commands[i].desc);
c0100da0:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0100da3:	89 d0                	mov    %edx,%eax
c0100da5:	01 c0                	add    %eax,%eax
c0100da7:	01 d0                	add    %edx,%eax
c0100da9:	c1 e0 02             	shl    $0x2,%eax
c0100dac:	05 04 20 12 c0       	add    $0xc0122004,%eax
c0100db1:	8b 08                	mov    (%eax),%ecx
c0100db3:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0100db6:	89 d0                	mov    %edx,%eax
c0100db8:	01 c0                	add    %eax,%eax
c0100dba:	01 d0                	add    %edx,%eax
c0100dbc:	c1 e0 02             	shl    $0x2,%eax
c0100dbf:	05 00 20 12 c0       	add    $0xc0122000,%eax
c0100dc4:	8b 00                	mov    (%eax),%eax
c0100dc6:	83 ec 04             	sub    $0x4,%esp
c0100dc9:	51                   	push   %ecx
c0100dca:	50                   	push   %eax
c0100dcb:	68 89 87 10 c0       	push   $0xc0108789
c0100dd0:	e8 d5 f4 ff ff       	call   c01002aa <cprintf>
c0100dd5:	83 c4 10             	add    $0x10,%esp
    for (i = 0; i < NCOMMANDS; i ++) {
c0100dd8:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c0100ddc:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100ddf:	83 f8 02             	cmp    $0x2,%eax
c0100de2:	76 bc                	jbe    c0100da0 <mon_help+0x13>
    }
    return 0;
c0100de4:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100de9:	c9                   	leave  
c0100dea:	c3                   	ret    

c0100deb <mon_kerninfo>:
/* *
 * mon_kerninfo - call print_kerninfo in kern/debug/kdebug.c to
 * print the memory occupancy in kernel.
 * */
int
mon_kerninfo(int argc, char **argv, struct trapframe *tf) {
c0100deb:	f3 0f 1e fb          	endbr32 
c0100def:	55                   	push   %ebp
c0100df0:	89 e5                	mov    %esp,%ebp
c0100df2:	83 ec 08             	sub    $0x8,%esp
    print_kerninfo();
c0100df5:	e8 6c fb ff ff       	call   c0100966 <print_kerninfo>
    return 0;
c0100dfa:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100dff:	c9                   	leave  
c0100e00:	c3                   	ret    

c0100e01 <mon_backtrace>:
/* *
 * mon_backtrace - call print_stackframe in kern/debug/kdebug.c to
 * print a backtrace of the stack.
 * */
int
mon_backtrace(int argc, char **argv, struct trapframe *tf) {
c0100e01:	f3 0f 1e fb          	endbr32 
c0100e05:	55                   	push   %ebp
c0100e06:	89 e5                	mov    %esp,%ebp
c0100e08:	83 ec 08             	sub    $0x8,%esp
    print_stackframe();
c0100e0b:	e8 aa fc ff ff       	call   c0100aba <print_stackframe>
    return 0;
c0100e10:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100e15:	c9                   	leave  
c0100e16:	c3                   	ret    

c0100e17 <ide_wait_ready>:
    unsigned int size;          // Size in Sectors
    unsigned char model[41];    // Model in String
} ide_devices[MAX_IDE];

static int
ide_wait_ready(unsigned short iobase, bool check_error) {
c0100e17:	f3 0f 1e fb          	endbr32 
c0100e1b:	55                   	push   %ebp
c0100e1c:	89 e5                	mov    %esp,%ebp
c0100e1e:	83 ec 14             	sub    $0x14,%esp
c0100e21:	8b 45 08             	mov    0x8(%ebp),%eax
c0100e24:	66 89 45 ec          	mov    %ax,-0x14(%ebp)
    int r;
    while ((r = inb(iobase + ISA_STATUS)) & IDE_BSY)
c0100e28:	90                   	nop
c0100e29:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
c0100e2d:	83 c0 07             	add    $0x7,%eax
c0100e30:	0f b7 c0             	movzwl %ax,%eax
c0100e33:	66 89 45 fa          	mov    %ax,-0x6(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0100e37:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
c0100e3b:	89 c2                	mov    %eax,%edx
c0100e3d:	ec                   	in     (%dx),%al
c0100e3e:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
c0100e41:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c0100e45:	0f b6 c0             	movzbl %al,%eax
c0100e48:	89 45 fc             	mov    %eax,-0x4(%ebp)
c0100e4b:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100e4e:	25 80 00 00 00       	and    $0x80,%eax
c0100e53:	85 c0                	test   %eax,%eax
c0100e55:	75 d2                	jne    c0100e29 <ide_wait_ready+0x12>
        /* nothing */;
    if (check_error && (r & (IDE_DF | IDE_ERR)) != 0) {
c0100e57:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0100e5b:	74 11                	je     c0100e6e <ide_wait_ready+0x57>
c0100e5d:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100e60:	83 e0 21             	and    $0x21,%eax
c0100e63:	85 c0                	test   %eax,%eax
c0100e65:	74 07                	je     c0100e6e <ide_wait_ready+0x57>
        return -1;
c0100e67:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0100e6c:	eb 05                	jmp    c0100e73 <ide_wait_ready+0x5c>
    }
    return 0;
c0100e6e:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100e73:	c9                   	leave  
c0100e74:	c3                   	ret    

c0100e75 <ide_init>:

void
ide_init(void) {
c0100e75:	f3 0f 1e fb          	endbr32 
c0100e79:	55                   	push   %ebp
c0100e7a:	89 e5                	mov    %esp,%ebp
c0100e7c:	57                   	push   %edi
c0100e7d:	53                   	push   %ebx
c0100e7e:	81 ec 40 02 00 00    	sub    $0x240,%esp
    static_assert((SECTSIZE % 4) == 0);
    unsigned short ideno, iobase;
    for (ideno = 0; ideno < MAX_IDE; ideno ++) {
c0100e84:	66 c7 45 f6 00 00    	movw   $0x0,-0xa(%ebp)
c0100e8a:	e9 6b 02 00 00       	jmp    c01010fa <ide_init+0x285>
        /* assume that no device here */
        ide_devices[ideno].valid = 0;
c0100e8f:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c0100e93:	6b c0 38             	imul   $0x38,%eax,%eax
c0100e96:	05 40 54 12 c0       	add    $0xc0125440,%eax
c0100e9b:	c6 00 00             	movb   $0x0,(%eax)

        iobase = IO_BASE(ideno);
c0100e9e:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c0100ea2:	66 d1 e8             	shr    %ax
c0100ea5:	0f b7 c0             	movzwl %ax,%eax
c0100ea8:	0f b7 04 85 94 87 10 	movzwl -0x3fef786c(,%eax,4),%eax
c0100eaf:	c0 
c0100eb0:	66 89 45 ea          	mov    %ax,-0x16(%ebp)

        /* wait device ready */
        ide_wait_ready(iobase, 0);
c0100eb4:	0f b7 45 ea          	movzwl -0x16(%ebp),%eax
c0100eb8:	6a 00                	push   $0x0
c0100eba:	50                   	push   %eax
c0100ebb:	e8 57 ff ff ff       	call   c0100e17 <ide_wait_ready>
c0100ec0:	83 c4 08             	add    $0x8,%esp

        /* step1: select drive */
        outb(iobase + ISA_SDH, 0xE0 | ((ideno & 1) << 4));
c0100ec3:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c0100ec7:	c1 e0 04             	shl    $0x4,%eax
c0100eca:	83 e0 10             	and    $0x10,%eax
c0100ecd:	83 c8 e0             	or     $0xffffffe0,%eax
c0100ed0:	0f b6 c0             	movzbl %al,%eax
c0100ed3:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c0100ed7:	83 c2 06             	add    $0x6,%edx
c0100eda:	0f b7 d2             	movzwl %dx,%edx
c0100edd:	66 89 55 ca          	mov    %dx,-0x36(%ebp)
c0100ee1:	88 45 c9             	mov    %al,-0x37(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100ee4:	0f b6 45 c9          	movzbl -0x37(%ebp),%eax
c0100ee8:	0f b7 55 ca          	movzwl -0x36(%ebp),%edx
c0100eec:	ee                   	out    %al,(%dx)
}
c0100eed:	90                   	nop
        ide_wait_ready(iobase, 0);
c0100eee:	0f b7 45 ea          	movzwl -0x16(%ebp),%eax
c0100ef2:	6a 00                	push   $0x0
c0100ef4:	50                   	push   %eax
c0100ef5:	e8 1d ff ff ff       	call   c0100e17 <ide_wait_ready>
c0100efa:	83 c4 08             	add    $0x8,%esp

        /* step2: send ATA identify command */
        outb(iobase + ISA_COMMAND, IDE_CMD_IDENTIFY);
c0100efd:	0f b7 45 ea          	movzwl -0x16(%ebp),%eax
c0100f01:	83 c0 07             	add    $0x7,%eax
c0100f04:	0f b7 c0             	movzwl %ax,%eax
c0100f07:	66 89 45 ce          	mov    %ax,-0x32(%ebp)
c0100f0b:	c6 45 cd ec          	movb   $0xec,-0x33(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100f0f:	0f b6 45 cd          	movzbl -0x33(%ebp),%eax
c0100f13:	0f b7 55 ce          	movzwl -0x32(%ebp),%edx
c0100f17:	ee                   	out    %al,(%dx)
}
c0100f18:	90                   	nop
        ide_wait_ready(iobase, 0);
c0100f19:	0f b7 45 ea          	movzwl -0x16(%ebp),%eax
c0100f1d:	6a 00                	push   $0x0
c0100f1f:	50                   	push   %eax
c0100f20:	e8 f2 fe ff ff       	call   c0100e17 <ide_wait_ready>
c0100f25:	83 c4 08             	add    $0x8,%esp

        /* step3: polling */
        if (inb(iobase + ISA_STATUS) == 0 || ide_wait_ready(iobase, 1) != 0) {
c0100f28:	0f b7 45 ea          	movzwl -0x16(%ebp),%eax
c0100f2c:	83 c0 07             	add    $0x7,%eax
c0100f2f:	0f b7 c0             	movzwl %ax,%eax
c0100f32:	66 89 45 d2          	mov    %ax,-0x2e(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0100f36:	0f b7 45 d2          	movzwl -0x2e(%ebp),%eax
c0100f3a:	89 c2                	mov    %eax,%edx
c0100f3c:	ec                   	in     (%dx),%al
c0100f3d:	88 45 d1             	mov    %al,-0x2f(%ebp)
    return data;
c0100f40:	0f b6 45 d1          	movzbl -0x2f(%ebp),%eax
c0100f44:	84 c0                	test   %al,%al
c0100f46:	0f 84 a2 01 00 00    	je     c01010ee <ide_init+0x279>
c0100f4c:	0f b7 45 ea          	movzwl -0x16(%ebp),%eax
c0100f50:	6a 01                	push   $0x1
c0100f52:	50                   	push   %eax
c0100f53:	e8 bf fe ff ff       	call   c0100e17 <ide_wait_ready>
c0100f58:	83 c4 08             	add    $0x8,%esp
c0100f5b:	85 c0                	test   %eax,%eax
c0100f5d:	0f 85 8b 01 00 00    	jne    c01010ee <ide_init+0x279>
            continue ;
        }

        /* device is ok */
        ide_devices[ideno].valid = 1;
c0100f63:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c0100f67:	6b c0 38             	imul   $0x38,%eax,%eax
c0100f6a:	05 40 54 12 c0       	add    $0xc0125440,%eax
c0100f6f:	c6 00 01             	movb   $0x1,(%eax)

        /* read identification space of the device */
        unsigned int buffer[128];
        insl(iobase + ISA_DATA, buffer, sizeof(buffer) / sizeof(unsigned int));
c0100f72:	0f b7 45 ea          	movzwl -0x16(%ebp),%eax
c0100f76:	89 45 c4             	mov    %eax,-0x3c(%ebp)
c0100f79:	8d 85 bc fd ff ff    	lea    -0x244(%ebp),%eax
c0100f7f:	89 45 c0             	mov    %eax,-0x40(%ebp)
c0100f82:	c7 45 bc 80 00 00 00 	movl   $0x80,-0x44(%ebp)
    asm volatile (
c0100f89:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c0100f8c:	8b 4d c0             	mov    -0x40(%ebp),%ecx
c0100f8f:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0100f92:	89 cb                	mov    %ecx,%ebx
c0100f94:	89 df                	mov    %ebx,%edi
c0100f96:	89 c1                	mov    %eax,%ecx
c0100f98:	fc                   	cld    
c0100f99:	f2 6d                	repnz insl (%dx),%es:(%edi)
c0100f9b:	89 c8                	mov    %ecx,%eax
c0100f9d:	89 fb                	mov    %edi,%ebx
c0100f9f:	89 5d c0             	mov    %ebx,-0x40(%ebp)
c0100fa2:	89 45 bc             	mov    %eax,-0x44(%ebp)
}
c0100fa5:	90                   	nop

        unsigned char *ident = (unsigned char *)buffer;
c0100fa6:	8d 85 bc fd ff ff    	lea    -0x244(%ebp),%eax
c0100fac:	89 45 e4             	mov    %eax,-0x1c(%ebp)
        unsigned int sectors;
        unsigned int cmdsets = *(unsigned int *)(ident + IDE_IDENT_CMDSETS);
c0100faf:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100fb2:	8b 80 a4 00 00 00    	mov    0xa4(%eax),%eax
c0100fb8:	89 45 e0             	mov    %eax,-0x20(%ebp)
        /* device use 48-bits or 28-bits addressing */
        if (cmdsets & (1 << 26)) {
c0100fbb:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0100fbe:	25 00 00 00 04       	and    $0x4000000,%eax
c0100fc3:	85 c0                	test   %eax,%eax
c0100fc5:	74 0e                	je     c0100fd5 <ide_init+0x160>
            sectors = *(unsigned int *)(ident + IDE_IDENT_MAX_LBA_EXT);
c0100fc7:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100fca:	8b 80 c8 00 00 00    	mov    0xc8(%eax),%eax
c0100fd0:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0100fd3:	eb 09                	jmp    c0100fde <ide_init+0x169>
        }
        else {
            sectors = *(unsigned int *)(ident + IDE_IDENT_MAX_LBA);
c0100fd5:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100fd8:	8b 40 78             	mov    0x78(%eax),%eax
c0100fdb:	89 45 f0             	mov    %eax,-0x10(%ebp)
        }
        ide_devices[ideno].sets = cmdsets;
c0100fde:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c0100fe2:	6b c0 38             	imul   $0x38,%eax,%eax
c0100fe5:	8d 90 44 54 12 c0    	lea    -0x3fedabbc(%eax),%edx
c0100feb:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0100fee:	89 02                	mov    %eax,(%edx)
        ide_devices[ideno].size = sectors;
c0100ff0:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c0100ff4:	6b c0 38             	imul   $0x38,%eax,%eax
c0100ff7:	8d 90 48 54 12 c0    	lea    -0x3fedabb8(%eax),%edx
c0100ffd:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0101000:	89 02                	mov    %eax,(%edx)

        /* check if supports LBA */
        assert((*(unsigned short *)(ident + IDE_IDENT_CAPABILITIES) & 0x200) != 0);
c0101002:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0101005:	83 c0 62             	add    $0x62,%eax
c0101008:	0f b7 00             	movzwl (%eax),%eax
c010100b:	0f b7 c0             	movzwl %ax,%eax
c010100e:	25 00 02 00 00       	and    $0x200,%eax
c0101013:	85 c0                	test   %eax,%eax
c0101015:	75 16                	jne    c010102d <ide_init+0x1b8>
c0101017:	68 9c 87 10 c0       	push   $0xc010879c
c010101c:	68 df 87 10 c0       	push   $0xc01087df
c0101021:	6a 7d                	push   $0x7d
c0101023:	68 f4 87 10 c0       	push   $0xc01087f4
c0101028:	e8 f8 f3 ff ff       	call   c0100425 <__panic>

        unsigned char *model = ide_devices[ideno].model, *data = ident + IDE_IDENT_MODEL;
c010102d:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c0101031:	6b c0 38             	imul   $0x38,%eax,%eax
c0101034:	05 40 54 12 c0       	add    $0xc0125440,%eax
c0101039:	83 c0 0c             	add    $0xc,%eax
c010103c:	89 45 dc             	mov    %eax,-0x24(%ebp)
c010103f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0101042:	83 c0 36             	add    $0x36,%eax
c0101045:	89 45 d8             	mov    %eax,-0x28(%ebp)
        unsigned int i, length = 40;
c0101048:	c7 45 d4 28 00 00 00 	movl   $0x28,-0x2c(%ebp)
        for (i = 0; i < length; i += 2) {
c010104f:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
c0101056:	eb 34                	jmp    c010108c <ide_init+0x217>
            model[i] = data[i + 1], model[i + 1] = data[i];
c0101058:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010105b:	8d 50 01             	lea    0x1(%eax),%edx
c010105e:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0101061:	01 d0                	add    %edx,%eax
c0101063:	8b 4d dc             	mov    -0x24(%ebp),%ecx
c0101066:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0101069:	01 ca                	add    %ecx,%edx
c010106b:	0f b6 00             	movzbl (%eax),%eax
c010106e:	88 02                	mov    %al,(%edx)
c0101070:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0101073:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0101076:	01 d0                	add    %edx,%eax
c0101078:	8b 55 ec             	mov    -0x14(%ebp),%edx
c010107b:	8d 4a 01             	lea    0x1(%edx),%ecx
c010107e:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0101081:	01 ca                	add    %ecx,%edx
c0101083:	0f b6 00             	movzbl (%eax),%eax
c0101086:	88 02                	mov    %al,(%edx)
        for (i = 0; i < length; i += 2) {
c0101088:	83 45 ec 02          	addl   $0x2,-0x14(%ebp)
c010108c:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010108f:	3b 45 d4             	cmp    -0x2c(%ebp),%eax
c0101092:	72 c4                	jb     c0101058 <ide_init+0x1e3>
        }
        do {
            model[i] = '\0';
c0101094:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0101097:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010109a:	01 d0                	add    %edx,%eax
c010109c:	c6 00 00             	movb   $0x0,(%eax)
        } while (i -- > 0 && model[i] == ' ');
c010109f:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01010a2:	8d 50 ff             	lea    -0x1(%eax),%edx
c01010a5:	89 55 ec             	mov    %edx,-0x14(%ebp)
c01010a8:	85 c0                	test   %eax,%eax
c01010aa:	74 0f                	je     c01010bb <ide_init+0x246>
c01010ac:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01010af:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01010b2:	01 d0                	add    %edx,%eax
c01010b4:	0f b6 00             	movzbl (%eax),%eax
c01010b7:	3c 20                	cmp    $0x20,%al
c01010b9:	74 d9                	je     c0101094 <ide_init+0x21f>

        cprintf("ide %d: %10u(sectors), '%s'.\n", ideno, ide_devices[ideno].size, ide_devices[ideno].model);
c01010bb:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c01010bf:	6b c0 38             	imul   $0x38,%eax,%eax
c01010c2:	05 40 54 12 c0       	add    $0xc0125440,%eax
c01010c7:	8d 48 0c             	lea    0xc(%eax),%ecx
c01010ca:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c01010ce:	6b c0 38             	imul   $0x38,%eax,%eax
c01010d1:	05 48 54 12 c0       	add    $0xc0125448,%eax
c01010d6:	8b 10                	mov    (%eax),%edx
c01010d8:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c01010dc:	51                   	push   %ecx
c01010dd:	52                   	push   %edx
c01010de:	50                   	push   %eax
c01010df:	68 06 88 10 c0       	push   $0xc0108806
c01010e4:	e8 c1 f1 ff ff       	call   c01002aa <cprintf>
c01010e9:	83 c4 10             	add    $0x10,%esp
c01010ec:	eb 01                	jmp    c01010ef <ide_init+0x27a>
            continue ;
c01010ee:	90                   	nop
    for (ideno = 0; ideno < MAX_IDE; ideno ++) {
c01010ef:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c01010f3:	83 c0 01             	add    $0x1,%eax
c01010f6:	66 89 45 f6          	mov    %ax,-0xa(%ebp)
c01010fa:	66 83 7d f6 03       	cmpw   $0x3,-0xa(%ebp)
c01010ff:	0f 86 8a fd ff ff    	jbe    c0100e8f <ide_init+0x1a>
    }

    // enable ide interrupt
    pic_enable(IRQ_IDE1);
c0101105:	83 ec 0c             	sub    $0xc,%esp
c0101108:	6a 0e                	push   $0xe
c010110a:	e8 f0 0e 00 00       	call   c0101fff <pic_enable>
c010110f:	83 c4 10             	add    $0x10,%esp
    pic_enable(IRQ_IDE2);
c0101112:	83 ec 0c             	sub    $0xc,%esp
c0101115:	6a 0f                	push   $0xf
c0101117:	e8 e3 0e 00 00       	call   c0101fff <pic_enable>
c010111c:	83 c4 10             	add    $0x10,%esp
}
c010111f:	90                   	nop
c0101120:	8d 65 f8             	lea    -0x8(%ebp),%esp
c0101123:	5b                   	pop    %ebx
c0101124:	5f                   	pop    %edi
c0101125:	5d                   	pop    %ebp
c0101126:	c3                   	ret    

c0101127 <ide_device_valid>:

bool
ide_device_valid(unsigned short ideno) {
c0101127:	f3 0f 1e fb          	endbr32 
c010112b:	55                   	push   %ebp
c010112c:	89 e5                	mov    %esp,%ebp
c010112e:	83 ec 04             	sub    $0x4,%esp
c0101131:	8b 45 08             	mov    0x8(%ebp),%eax
c0101134:	66 89 45 fc          	mov    %ax,-0x4(%ebp)
    return VALID_IDE(ideno);
c0101138:	66 83 7d fc 03       	cmpw   $0x3,-0x4(%ebp)
c010113d:	77 1a                	ja     c0101159 <ide_device_valid+0x32>
c010113f:	0f b7 45 fc          	movzwl -0x4(%ebp),%eax
c0101143:	6b c0 38             	imul   $0x38,%eax,%eax
c0101146:	05 40 54 12 c0       	add    $0xc0125440,%eax
c010114b:	0f b6 00             	movzbl (%eax),%eax
c010114e:	84 c0                	test   %al,%al
c0101150:	74 07                	je     c0101159 <ide_device_valid+0x32>
c0101152:	b8 01 00 00 00       	mov    $0x1,%eax
c0101157:	eb 05                	jmp    c010115e <ide_device_valid+0x37>
c0101159:	b8 00 00 00 00       	mov    $0x0,%eax
}
c010115e:	c9                   	leave  
c010115f:	c3                   	ret    

c0101160 <ide_device_size>:

size_t
ide_device_size(unsigned short ideno) {
c0101160:	f3 0f 1e fb          	endbr32 
c0101164:	55                   	push   %ebp
c0101165:	89 e5                	mov    %esp,%ebp
c0101167:	83 ec 04             	sub    $0x4,%esp
c010116a:	8b 45 08             	mov    0x8(%ebp),%eax
c010116d:	66 89 45 fc          	mov    %ax,-0x4(%ebp)
    if (ide_device_valid(ideno)) {
c0101171:	0f b7 45 fc          	movzwl -0x4(%ebp),%eax
c0101175:	50                   	push   %eax
c0101176:	e8 ac ff ff ff       	call   c0101127 <ide_device_valid>
c010117b:	83 c4 04             	add    $0x4,%esp
c010117e:	85 c0                	test   %eax,%eax
c0101180:	74 10                	je     c0101192 <ide_device_size+0x32>
        return ide_devices[ideno].size;
c0101182:	0f b7 45 fc          	movzwl -0x4(%ebp),%eax
c0101186:	6b c0 38             	imul   $0x38,%eax,%eax
c0101189:	05 48 54 12 c0       	add    $0xc0125448,%eax
c010118e:	8b 00                	mov    (%eax),%eax
c0101190:	eb 05                	jmp    c0101197 <ide_device_size+0x37>
    }
    return 0;
c0101192:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0101197:	c9                   	leave  
c0101198:	c3                   	ret    

c0101199 <ide_read_secs>:

int
ide_read_secs(unsigned short ideno, uint32_t secno, void *dst, size_t nsecs) {
c0101199:	f3 0f 1e fb          	endbr32 
c010119d:	55                   	push   %ebp
c010119e:	89 e5                	mov    %esp,%ebp
c01011a0:	57                   	push   %edi
c01011a1:	53                   	push   %ebx
c01011a2:	83 ec 40             	sub    $0x40,%esp
c01011a5:	8b 45 08             	mov    0x8(%ebp),%eax
c01011a8:	66 89 45 c4          	mov    %ax,-0x3c(%ebp)
    assert(nsecs <= MAX_NSECS && VALID_IDE(ideno));
c01011ac:	81 7d 14 80 00 00 00 	cmpl   $0x80,0x14(%ebp)
c01011b3:	77 1a                	ja     c01011cf <ide_read_secs+0x36>
c01011b5:	66 83 7d c4 03       	cmpw   $0x3,-0x3c(%ebp)
c01011ba:	77 13                	ja     c01011cf <ide_read_secs+0x36>
c01011bc:	0f b7 45 c4          	movzwl -0x3c(%ebp),%eax
c01011c0:	6b c0 38             	imul   $0x38,%eax,%eax
c01011c3:	05 40 54 12 c0       	add    $0xc0125440,%eax
c01011c8:	0f b6 00             	movzbl (%eax),%eax
c01011cb:	84 c0                	test   %al,%al
c01011cd:	75 19                	jne    c01011e8 <ide_read_secs+0x4f>
c01011cf:	68 24 88 10 c0       	push   $0xc0108824
c01011d4:	68 df 87 10 c0       	push   $0xc01087df
c01011d9:	68 9f 00 00 00       	push   $0x9f
c01011de:	68 f4 87 10 c0       	push   $0xc01087f4
c01011e3:	e8 3d f2 ff ff       	call   c0100425 <__panic>
    assert(secno < MAX_DISK_NSECS && secno + nsecs <= MAX_DISK_NSECS);
c01011e8:	81 7d 0c ff ff ff 0f 	cmpl   $0xfffffff,0xc(%ebp)
c01011ef:	77 0f                	ja     c0101200 <ide_read_secs+0x67>
c01011f1:	8b 55 0c             	mov    0xc(%ebp),%edx
c01011f4:	8b 45 14             	mov    0x14(%ebp),%eax
c01011f7:	01 d0                	add    %edx,%eax
c01011f9:	3d 00 00 00 10       	cmp    $0x10000000,%eax
c01011fe:	76 19                	jbe    c0101219 <ide_read_secs+0x80>
c0101200:	68 4c 88 10 c0       	push   $0xc010884c
c0101205:	68 df 87 10 c0       	push   $0xc01087df
c010120a:	68 a0 00 00 00       	push   $0xa0
c010120f:	68 f4 87 10 c0       	push   $0xc01087f4
c0101214:	e8 0c f2 ff ff       	call   c0100425 <__panic>
    unsigned short iobase = IO_BASE(ideno), ioctrl = IO_CTRL(ideno);
c0101219:	0f b7 45 c4          	movzwl -0x3c(%ebp),%eax
c010121d:	66 d1 e8             	shr    %ax
c0101220:	0f b7 c0             	movzwl %ax,%eax
c0101223:	0f b7 04 85 94 87 10 	movzwl -0x3fef786c(,%eax,4),%eax
c010122a:	c0 
c010122b:	66 89 45 f2          	mov    %ax,-0xe(%ebp)
c010122f:	0f b7 45 c4          	movzwl -0x3c(%ebp),%eax
c0101233:	66 d1 e8             	shr    %ax
c0101236:	0f b7 c0             	movzwl %ax,%eax
c0101239:	0f b7 04 85 96 87 10 	movzwl -0x3fef786a(,%eax,4),%eax
c0101240:	c0 
c0101241:	66 89 45 f0          	mov    %ax,-0x10(%ebp)

    ide_wait_ready(iobase, 0);
c0101245:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c0101249:	83 ec 08             	sub    $0x8,%esp
c010124c:	6a 00                	push   $0x0
c010124e:	50                   	push   %eax
c010124f:	e8 c3 fb ff ff       	call   c0100e17 <ide_wait_ready>
c0101254:	83 c4 10             	add    $0x10,%esp

    // generate interrupt
    outb(ioctrl + ISA_CTRL, 0);
c0101257:	0f b7 45 f0          	movzwl -0x10(%ebp),%eax
c010125b:	83 c0 02             	add    $0x2,%eax
c010125e:	0f b7 c0             	movzwl %ax,%eax
c0101261:	66 89 45 d6          	mov    %ax,-0x2a(%ebp)
c0101265:	c6 45 d5 00          	movb   $0x0,-0x2b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101269:	0f b6 45 d5          	movzbl -0x2b(%ebp),%eax
c010126d:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
c0101271:	ee                   	out    %al,(%dx)
}
c0101272:	90                   	nop
    outb(iobase + ISA_SECCNT, nsecs);
c0101273:	8b 45 14             	mov    0x14(%ebp),%eax
c0101276:	0f b6 c0             	movzbl %al,%eax
c0101279:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c010127d:	83 c2 02             	add    $0x2,%edx
c0101280:	0f b7 d2             	movzwl %dx,%edx
c0101283:	66 89 55 da          	mov    %dx,-0x26(%ebp)
c0101287:	88 45 d9             	mov    %al,-0x27(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010128a:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
c010128e:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
c0101292:	ee                   	out    %al,(%dx)
}
c0101293:	90                   	nop
    outb(iobase + ISA_SECTOR, secno & 0xFF);
c0101294:	8b 45 0c             	mov    0xc(%ebp),%eax
c0101297:	0f b6 c0             	movzbl %al,%eax
c010129a:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c010129e:	83 c2 03             	add    $0x3,%edx
c01012a1:	0f b7 d2             	movzwl %dx,%edx
c01012a4:	66 89 55 de          	mov    %dx,-0x22(%ebp)
c01012a8:	88 45 dd             	mov    %al,-0x23(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01012ab:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
c01012af:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
c01012b3:	ee                   	out    %al,(%dx)
}
c01012b4:	90                   	nop
    outb(iobase + ISA_CYL_LO, (secno >> 8) & 0xFF);
c01012b5:	8b 45 0c             	mov    0xc(%ebp),%eax
c01012b8:	c1 e8 08             	shr    $0x8,%eax
c01012bb:	0f b6 c0             	movzbl %al,%eax
c01012be:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c01012c2:	83 c2 04             	add    $0x4,%edx
c01012c5:	0f b7 d2             	movzwl %dx,%edx
c01012c8:	66 89 55 e2          	mov    %dx,-0x1e(%ebp)
c01012cc:	88 45 e1             	mov    %al,-0x1f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01012cf:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
c01012d3:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
c01012d7:	ee                   	out    %al,(%dx)
}
c01012d8:	90                   	nop
    outb(iobase + ISA_CYL_HI, (secno >> 16) & 0xFF);
c01012d9:	8b 45 0c             	mov    0xc(%ebp),%eax
c01012dc:	c1 e8 10             	shr    $0x10,%eax
c01012df:	0f b6 c0             	movzbl %al,%eax
c01012e2:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c01012e6:	83 c2 05             	add    $0x5,%edx
c01012e9:	0f b7 d2             	movzwl %dx,%edx
c01012ec:	66 89 55 e6          	mov    %dx,-0x1a(%ebp)
c01012f0:	88 45 e5             	mov    %al,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01012f3:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c01012f7:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c01012fb:	ee                   	out    %al,(%dx)
}
c01012fc:	90                   	nop
    outb(iobase + ISA_SDH, 0xE0 | ((ideno & 1) << 4) | ((secno >> 24) & 0xF));
c01012fd:	0f b7 45 c4          	movzwl -0x3c(%ebp),%eax
c0101301:	c1 e0 04             	shl    $0x4,%eax
c0101304:	83 e0 10             	and    $0x10,%eax
c0101307:	89 c2                	mov    %eax,%edx
c0101309:	8b 45 0c             	mov    0xc(%ebp),%eax
c010130c:	c1 e8 18             	shr    $0x18,%eax
c010130f:	83 e0 0f             	and    $0xf,%eax
c0101312:	09 d0                	or     %edx,%eax
c0101314:	83 c8 e0             	or     $0xffffffe0,%eax
c0101317:	0f b6 c0             	movzbl %al,%eax
c010131a:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c010131e:	83 c2 06             	add    $0x6,%edx
c0101321:	0f b7 d2             	movzwl %dx,%edx
c0101324:	66 89 55 ea          	mov    %dx,-0x16(%ebp)
c0101328:	88 45 e9             	mov    %al,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010132b:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c010132f:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c0101333:	ee                   	out    %al,(%dx)
}
c0101334:	90                   	nop
    outb(iobase + ISA_COMMAND, IDE_CMD_READ);
c0101335:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c0101339:	83 c0 07             	add    $0x7,%eax
c010133c:	0f b7 c0             	movzwl %ax,%eax
c010133f:	66 89 45 ee          	mov    %ax,-0x12(%ebp)
c0101343:	c6 45 ed 20          	movb   $0x20,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101347:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c010134b:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c010134f:	ee                   	out    %al,(%dx)
}
c0101350:	90                   	nop

    int ret = 0;
c0101351:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    for (; nsecs > 0; nsecs --, dst += SECTSIZE) {
c0101358:	eb 57                	jmp    c01013b1 <ide_read_secs+0x218>
        if ((ret = ide_wait_ready(iobase, 1)) != 0) {
c010135a:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c010135e:	83 ec 08             	sub    $0x8,%esp
c0101361:	6a 01                	push   $0x1
c0101363:	50                   	push   %eax
c0101364:	e8 ae fa ff ff       	call   c0100e17 <ide_wait_ready>
c0101369:	83 c4 10             	add    $0x10,%esp
c010136c:	89 45 f4             	mov    %eax,-0xc(%ebp)
c010136f:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0101373:	75 44                	jne    c01013b9 <ide_read_secs+0x220>
            goto out;
        }
        insl(iobase, dst, SECTSIZE / sizeof(uint32_t));
c0101375:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c0101379:	89 45 d0             	mov    %eax,-0x30(%ebp)
c010137c:	8b 45 10             	mov    0x10(%ebp),%eax
c010137f:	89 45 cc             	mov    %eax,-0x34(%ebp)
c0101382:	c7 45 c8 80 00 00 00 	movl   $0x80,-0x38(%ebp)
    asm volatile (
c0101389:	8b 55 d0             	mov    -0x30(%ebp),%edx
c010138c:	8b 4d cc             	mov    -0x34(%ebp),%ecx
c010138f:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0101392:	89 cb                	mov    %ecx,%ebx
c0101394:	89 df                	mov    %ebx,%edi
c0101396:	89 c1                	mov    %eax,%ecx
c0101398:	fc                   	cld    
c0101399:	f2 6d                	repnz insl (%dx),%es:(%edi)
c010139b:	89 c8                	mov    %ecx,%eax
c010139d:	89 fb                	mov    %edi,%ebx
c010139f:	89 5d cc             	mov    %ebx,-0x34(%ebp)
c01013a2:	89 45 c8             	mov    %eax,-0x38(%ebp)
}
c01013a5:	90                   	nop
    for (; nsecs > 0; nsecs --, dst += SECTSIZE) {
c01013a6:	83 6d 14 01          	subl   $0x1,0x14(%ebp)
c01013aa:	81 45 10 00 02 00 00 	addl   $0x200,0x10(%ebp)
c01013b1:	83 7d 14 00          	cmpl   $0x0,0x14(%ebp)
c01013b5:	75 a3                	jne    c010135a <ide_read_secs+0x1c1>
    }

out:
c01013b7:	eb 01                	jmp    c01013ba <ide_read_secs+0x221>
            goto out;
c01013b9:	90                   	nop
    return ret;
c01013ba:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c01013bd:	8d 65 f8             	lea    -0x8(%ebp),%esp
c01013c0:	5b                   	pop    %ebx
c01013c1:	5f                   	pop    %edi
c01013c2:	5d                   	pop    %ebp
c01013c3:	c3                   	ret    

c01013c4 <ide_write_secs>:

int
ide_write_secs(unsigned short ideno, uint32_t secno, const void *src, size_t nsecs) {
c01013c4:	f3 0f 1e fb          	endbr32 
c01013c8:	55                   	push   %ebp
c01013c9:	89 e5                	mov    %esp,%ebp
c01013cb:	56                   	push   %esi
c01013cc:	53                   	push   %ebx
c01013cd:	83 ec 40             	sub    $0x40,%esp
c01013d0:	8b 45 08             	mov    0x8(%ebp),%eax
c01013d3:	66 89 45 c4          	mov    %ax,-0x3c(%ebp)
    assert(nsecs <= MAX_NSECS && VALID_IDE(ideno));
c01013d7:	81 7d 14 80 00 00 00 	cmpl   $0x80,0x14(%ebp)
c01013de:	77 1a                	ja     c01013fa <ide_write_secs+0x36>
c01013e0:	66 83 7d c4 03       	cmpw   $0x3,-0x3c(%ebp)
c01013e5:	77 13                	ja     c01013fa <ide_write_secs+0x36>
c01013e7:	0f b7 45 c4          	movzwl -0x3c(%ebp),%eax
c01013eb:	6b c0 38             	imul   $0x38,%eax,%eax
c01013ee:	05 40 54 12 c0       	add    $0xc0125440,%eax
c01013f3:	0f b6 00             	movzbl (%eax),%eax
c01013f6:	84 c0                	test   %al,%al
c01013f8:	75 19                	jne    c0101413 <ide_write_secs+0x4f>
c01013fa:	68 24 88 10 c0       	push   $0xc0108824
c01013ff:	68 df 87 10 c0       	push   $0xc01087df
c0101404:	68 bc 00 00 00       	push   $0xbc
c0101409:	68 f4 87 10 c0       	push   $0xc01087f4
c010140e:	e8 12 f0 ff ff       	call   c0100425 <__panic>
    assert(secno < MAX_DISK_NSECS && secno + nsecs <= MAX_DISK_NSECS);
c0101413:	81 7d 0c ff ff ff 0f 	cmpl   $0xfffffff,0xc(%ebp)
c010141a:	77 0f                	ja     c010142b <ide_write_secs+0x67>
c010141c:	8b 55 0c             	mov    0xc(%ebp),%edx
c010141f:	8b 45 14             	mov    0x14(%ebp),%eax
c0101422:	01 d0                	add    %edx,%eax
c0101424:	3d 00 00 00 10       	cmp    $0x10000000,%eax
c0101429:	76 19                	jbe    c0101444 <ide_write_secs+0x80>
c010142b:	68 4c 88 10 c0       	push   $0xc010884c
c0101430:	68 df 87 10 c0       	push   $0xc01087df
c0101435:	68 bd 00 00 00       	push   $0xbd
c010143a:	68 f4 87 10 c0       	push   $0xc01087f4
c010143f:	e8 e1 ef ff ff       	call   c0100425 <__panic>
    unsigned short iobase = IO_BASE(ideno), ioctrl = IO_CTRL(ideno);
c0101444:	0f b7 45 c4          	movzwl -0x3c(%ebp),%eax
c0101448:	66 d1 e8             	shr    %ax
c010144b:	0f b7 c0             	movzwl %ax,%eax
c010144e:	0f b7 04 85 94 87 10 	movzwl -0x3fef786c(,%eax,4),%eax
c0101455:	c0 
c0101456:	66 89 45 f2          	mov    %ax,-0xe(%ebp)
c010145a:	0f b7 45 c4          	movzwl -0x3c(%ebp),%eax
c010145e:	66 d1 e8             	shr    %ax
c0101461:	0f b7 c0             	movzwl %ax,%eax
c0101464:	0f b7 04 85 96 87 10 	movzwl -0x3fef786a(,%eax,4),%eax
c010146b:	c0 
c010146c:	66 89 45 f0          	mov    %ax,-0x10(%ebp)

    ide_wait_ready(iobase, 0);
c0101470:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c0101474:	83 ec 08             	sub    $0x8,%esp
c0101477:	6a 00                	push   $0x0
c0101479:	50                   	push   %eax
c010147a:	e8 98 f9 ff ff       	call   c0100e17 <ide_wait_ready>
c010147f:	83 c4 10             	add    $0x10,%esp

    // generate interrupt
    outb(ioctrl + ISA_CTRL, 0);
c0101482:	0f b7 45 f0          	movzwl -0x10(%ebp),%eax
c0101486:	83 c0 02             	add    $0x2,%eax
c0101489:	0f b7 c0             	movzwl %ax,%eax
c010148c:	66 89 45 d6          	mov    %ax,-0x2a(%ebp)
c0101490:	c6 45 d5 00          	movb   $0x0,-0x2b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101494:	0f b6 45 d5          	movzbl -0x2b(%ebp),%eax
c0101498:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
c010149c:	ee                   	out    %al,(%dx)
}
c010149d:	90                   	nop
    outb(iobase + ISA_SECCNT, nsecs);
c010149e:	8b 45 14             	mov    0x14(%ebp),%eax
c01014a1:	0f b6 c0             	movzbl %al,%eax
c01014a4:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c01014a8:	83 c2 02             	add    $0x2,%edx
c01014ab:	0f b7 d2             	movzwl %dx,%edx
c01014ae:	66 89 55 da          	mov    %dx,-0x26(%ebp)
c01014b2:	88 45 d9             	mov    %al,-0x27(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01014b5:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
c01014b9:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
c01014bd:	ee                   	out    %al,(%dx)
}
c01014be:	90                   	nop
    outb(iobase + ISA_SECTOR, secno & 0xFF);
c01014bf:	8b 45 0c             	mov    0xc(%ebp),%eax
c01014c2:	0f b6 c0             	movzbl %al,%eax
c01014c5:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c01014c9:	83 c2 03             	add    $0x3,%edx
c01014cc:	0f b7 d2             	movzwl %dx,%edx
c01014cf:	66 89 55 de          	mov    %dx,-0x22(%ebp)
c01014d3:	88 45 dd             	mov    %al,-0x23(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01014d6:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
c01014da:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
c01014de:	ee                   	out    %al,(%dx)
}
c01014df:	90                   	nop
    outb(iobase + ISA_CYL_LO, (secno >> 8) & 0xFF);
c01014e0:	8b 45 0c             	mov    0xc(%ebp),%eax
c01014e3:	c1 e8 08             	shr    $0x8,%eax
c01014e6:	0f b6 c0             	movzbl %al,%eax
c01014e9:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c01014ed:	83 c2 04             	add    $0x4,%edx
c01014f0:	0f b7 d2             	movzwl %dx,%edx
c01014f3:	66 89 55 e2          	mov    %dx,-0x1e(%ebp)
c01014f7:	88 45 e1             	mov    %al,-0x1f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01014fa:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
c01014fe:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
c0101502:	ee                   	out    %al,(%dx)
}
c0101503:	90                   	nop
    outb(iobase + ISA_CYL_HI, (secno >> 16) & 0xFF);
c0101504:	8b 45 0c             	mov    0xc(%ebp),%eax
c0101507:	c1 e8 10             	shr    $0x10,%eax
c010150a:	0f b6 c0             	movzbl %al,%eax
c010150d:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c0101511:	83 c2 05             	add    $0x5,%edx
c0101514:	0f b7 d2             	movzwl %dx,%edx
c0101517:	66 89 55 e6          	mov    %dx,-0x1a(%ebp)
c010151b:	88 45 e5             	mov    %al,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010151e:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c0101522:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c0101526:	ee                   	out    %al,(%dx)
}
c0101527:	90                   	nop
    outb(iobase + ISA_SDH, 0xE0 | ((ideno & 1) << 4) | ((secno >> 24) & 0xF));
c0101528:	0f b7 45 c4          	movzwl -0x3c(%ebp),%eax
c010152c:	c1 e0 04             	shl    $0x4,%eax
c010152f:	83 e0 10             	and    $0x10,%eax
c0101532:	89 c2                	mov    %eax,%edx
c0101534:	8b 45 0c             	mov    0xc(%ebp),%eax
c0101537:	c1 e8 18             	shr    $0x18,%eax
c010153a:	83 e0 0f             	and    $0xf,%eax
c010153d:	09 d0                	or     %edx,%eax
c010153f:	83 c8 e0             	or     $0xffffffe0,%eax
c0101542:	0f b6 c0             	movzbl %al,%eax
c0101545:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c0101549:	83 c2 06             	add    $0x6,%edx
c010154c:	0f b7 d2             	movzwl %dx,%edx
c010154f:	66 89 55 ea          	mov    %dx,-0x16(%ebp)
c0101553:	88 45 e9             	mov    %al,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101556:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c010155a:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c010155e:	ee                   	out    %al,(%dx)
}
c010155f:	90                   	nop
    outb(iobase + ISA_COMMAND, IDE_CMD_WRITE);
c0101560:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c0101564:	83 c0 07             	add    $0x7,%eax
c0101567:	0f b7 c0             	movzwl %ax,%eax
c010156a:	66 89 45 ee          	mov    %ax,-0x12(%ebp)
c010156e:	c6 45 ed 30          	movb   $0x30,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101572:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101576:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c010157a:	ee                   	out    %al,(%dx)
}
c010157b:	90                   	nop

    int ret = 0;
c010157c:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    for (; nsecs > 0; nsecs --, src += SECTSIZE) {
c0101583:	eb 57                	jmp    c01015dc <ide_write_secs+0x218>
        if ((ret = ide_wait_ready(iobase, 1)) != 0) {
c0101585:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c0101589:	83 ec 08             	sub    $0x8,%esp
c010158c:	6a 01                	push   $0x1
c010158e:	50                   	push   %eax
c010158f:	e8 83 f8 ff ff       	call   c0100e17 <ide_wait_ready>
c0101594:	83 c4 10             	add    $0x10,%esp
c0101597:	89 45 f4             	mov    %eax,-0xc(%ebp)
c010159a:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c010159e:	75 44                	jne    c01015e4 <ide_write_secs+0x220>
            goto out;
        }
        outsl(iobase, src, SECTSIZE / sizeof(uint32_t));
c01015a0:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c01015a4:	89 45 d0             	mov    %eax,-0x30(%ebp)
c01015a7:	8b 45 10             	mov    0x10(%ebp),%eax
c01015aa:	89 45 cc             	mov    %eax,-0x34(%ebp)
c01015ad:	c7 45 c8 80 00 00 00 	movl   $0x80,-0x38(%ebp)
    asm volatile (
c01015b4:	8b 55 d0             	mov    -0x30(%ebp),%edx
c01015b7:	8b 4d cc             	mov    -0x34(%ebp),%ecx
c01015ba:	8b 45 c8             	mov    -0x38(%ebp),%eax
c01015bd:	89 cb                	mov    %ecx,%ebx
c01015bf:	89 de                	mov    %ebx,%esi
c01015c1:	89 c1                	mov    %eax,%ecx
c01015c3:	fc                   	cld    
c01015c4:	f2 6f                	repnz outsl %ds:(%esi),(%dx)
c01015c6:	89 c8                	mov    %ecx,%eax
c01015c8:	89 f3                	mov    %esi,%ebx
c01015ca:	89 5d cc             	mov    %ebx,-0x34(%ebp)
c01015cd:	89 45 c8             	mov    %eax,-0x38(%ebp)
}
c01015d0:	90                   	nop
    for (; nsecs > 0; nsecs --, src += SECTSIZE) {
c01015d1:	83 6d 14 01          	subl   $0x1,0x14(%ebp)
c01015d5:	81 45 10 00 02 00 00 	addl   $0x200,0x10(%ebp)
c01015dc:	83 7d 14 00          	cmpl   $0x0,0x14(%ebp)
c01015e0:	75 a3                	jne    c0101585 <ide_write_secs+0x1c1>
    }

out:
c01015e2:	eb 01                	jmp    c01015e5 <ide_write_secs+0x221>
            goto out;
c01015e4:	90                   	nop
    return ret;
c01015e5:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c01015e8:	8d 65 f8             	lea    -0x8(%ebp),%esp
c01015eb:	5b                   	pop    %ebx
c01015ec:	5e                   	pop    %esi
c01015ed:	5d                   	pop    %ebp
c01015ee:	c3                   	ret    

c01015ef <clock_init>:
/* *
 * clock_init - initialize 8253 clock to interrupt 100 times per second,
 * and then enable IRQ_TIMER.
 * */
void
clock_init(void) {
c01015ef:	f3 0f 1e fb          	endbr32 
c01015f3:	55                   	push   %ebp
c01015f4:	89 e5                	mov    %esp,%ebp
c01015f6:	83 ec 18             	sub    $0x18,%esp
c01015f9:	66 c7 45 ee 43 00    	movw   $0x43,-0x12(%ebp)
c01015ff:	c6 45 ed 34          	movb   $0x34,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101603:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101607:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c010160b:	ee                   	out    %al,(%dx)
}
c010160c:	90                   	nop
c010160d:	66 c7 45 f2 40 00    	movw   $0x40,-0xe(%ebp)
c0101613:	c6 45 f1 9c          	movb   $0x9c,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101617:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c010161b:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c010161f:	ee                   	out    %al,(%dx)
}
c0101620:	90                   	nop
c0101621:	66 c7 45 f6 40 00    	movw   $0x40,-0xa(%ebp)
c0101627:	c6 45 f5 2e          	movb   $0x2e,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010162b:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c010162f:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c0101633:	ee                   	out    %al,(%dx)
}
c0101634:	90                   	nop
    outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
    outb(IO_TIMER1, TIMER_DIV(100) % 256);
    outb(IO_TIMER1, TIMER_DIV(100) / 256);

    // initialize time counter 'ticks' to zero
    ticks = 0;
c0101635:	c7 05 0c 60 12 c0 00 	movl   $0x0,0xc012600c
c010163c:	00 00 00 

    cprintf("++ setup timer interrupts\n");
c010163f:	83 ec 0c             	sub    $0xc,%esp
c0101642:	68 86 88 10 c0       	push   $0xc0108886
c0101647:	e8 5e ec ff ff       	call   c01002aa <cprintf>
c010164c:	83 c4 10             	add    $0x10,%esp
    pic_enable(IRQ_TIMER);
c010164f:	83 ec 0c             	sub    $0xc,%esp
c0101652:	6a 00                	push   $0x0
c0101654:	e8 a6 09 00 00       	call   c0101fff <pic_enable>
c0101659:	83 c4 10             	add    $0x10,%esp
}
c010165c:	90                   	nop
c010165d:	c9                   	leave  
c010165e:	c3                   	ret    

c010165f <__intr_save>:
#include <x86.h>
#include <intr.h>
#include <mmu.h>

static inline bool
__intr_save(void) {
c010165f:	55                   	push   %ebp
c0101660:	89 e5                	mov    %esp,%ebp
c0101662:	83 ec 18             	sub    $0x18,%esp
}

static inline uint32_t
read_eflags(void) {
    uint32_t eflags;
    asm volatile ("pushfl; popl %0" : "=r" (eflags));
c0101665:	9c                   	pushf  
c0101666:	58                   	pop    %eax
c0101667:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return eflags;
c010166a:	8b 45 f4             	mov    -0xc(%ebp),%eax
    if (read_eflags() & FL_IF) {
c010166d:	25 00 02 00 00       	and    $0x200,%eax
c0101672:	85 c0                	test   %eax,%eax
c0101674:	74 0c                	je     c0101682 <__intr_save+0x23>
        intr_disable();
c0101676:	e8 10 0b 00 00       	call   c010218b <intr_disable>
        return 1;
c010167b:	b8 01 00 00 00       	mov    $0x1,%eax
c0101680:	eb 05                	jmp    c0101687 <__intr_save+0x28>
    }
    return 0;
c0101682:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0101687:	c9                   	leave  
c0101688:	c3                   	ret    

c0101689 <__intr_restore>:

static inline void
__intr_restore(bool flag) {
c0101689:	55                   	push   %ebp
c010168a:	89 e5                	mov    %esp,%ebp
c010168c:	83 ec 08             	sub    $0x8,%esp
    if (flag) {
c010168f:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0101693:	74 05                	je     c010169a <__intr_restore+0x11>
        intr_enable();
c0101695:	e8 e5 0a 00 00       	call   c010217f <intr_enable>
    }
}
c010169a:	90                   	nop
c010169b:	c9                   	leave  
c010169c:	c3                   	ret    

c010169d <delay>:
#include <memlayout.h>
#include <sync.h>

/* stupid I/O delay routine necessitated by historical PC design flaws */
static void
delay(void) {
c010169d:	f3 0f 1e fb          	endbr32 
c01016a1:	55                   	push   %ebp
c01016a2:	89 e5                	mov    %esp,%ebp
c01016a4:	83 ec 10             	sub    $0x10,%esp
c01016a7:	66 c7 45 f2 84 00    	movw   $0x84,-0xe(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c01016ad:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c01016b1:	89 c2                	mov    %eax,%edx
c01016b3:	ec                   	in     (%dx),%al
c01016b4:	88 45 f1             	mov    %al,-0xf(%ebp)
c01016b7:	66 c7 45 f6 84 00    	movw   $0x84,-0xa(%ebp)
c01016bd:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c01016c1:	89 c2                	mov    %eax,%edx
c01016c3:	ec                   	in     (%dx),%al
c01016c4:	88 45 f5             	mov    %al,-0xb(%ebp)
c01016c7:	66 c7 45 fa 84 00    	movw   $0x84,-0x6(%ebp)
c01016cd:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
c01016d1:	89 c2                	mov    %eax,%edx
c01016d3:	ec                   	in     (%dx),%al
c01016d4:	88 45 f9             	mov    %al,-0x7(%ebp)
c01016d7:	66 c7 45 fe 84 00    	movw   $0x84,-0x2(%ebp)
c01016dd:	0f b7 45 fe          	movzwl -0x2(%ebp),%eax
c01016e1:	89 c2                	mov    %eax,%edx
c01016e3:	ec                   	in     (%dx),%al
c01016e4:	88 45 fd             	mov    %al,-0x3(%ebp)
    inb(0x84);
    inb(0x84);
    inb(0x84);
    inb(0x84);
}
c01016e7:	90                   	nop
c01016e8:	c9                   	leave  
c01016e9:	c3                   	ret    

c01016ea <cga_init>:
static uint16_t addr_6845;

/* TEXT-mode CGA/VGA display output */

static void
cga_init(void) {
c01016ea:	f3 0f 1e fb          	endbr32 
c01016ee:	55                   	push   %ebp
c01016ef:	89 e5                	mov    %esp,%ebp
c01016f1:	83 ec 20             	sub    $0x20,%esp
    volatile uint16_t *cp = (uint16_t *)(CGA_BUF + KERNBASE);
c01016f4:	c7 45 fc 00 80 0b c0 	movl   $0xc00b8000,-0x4(%ebp)
    uint16_t was = *cp;
c01016fb:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01016fe:	0f b7 00             	movzwl (%eax),%eax
c0101701:	66 89 45 fa          	mov    %ax,-0x6(%ebp)
    *cp = (uint16_t) 0xA55A;
c0101705:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0101708:	66 c7 00 5a a5       	movw   $0xa55a,(%eax)
    if (*cp != 0xA55A) {
c010170d:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0101710:	0f b7 00             	movzwl (%eax),%eax
c0101713:	66 3d 5a a5          	cmp    $0xa55a,%ax
c0101717:	74 12                	je     c010172b <cga_init+0x41>
        cp = (uint16_t*)(MONO_BUF + KERNBASE);
c0101719:	c7 45 fc 00 00 0b c0 	movl   $0xc00b0000,-0x4(%ebp)
        addr_6845 = MONO_BASE;
c0101720:	66 c7 05 26 55 12 c0 	movw   $0x3b4,0xc0125526
c0101727:	b4 03 
c0101729:	eb 13                	jmp    c010173e <cga_init+0x54>
    } else {
        *cp = was;
c010172b:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010172e:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
c0101732:	66 89 10             	mov    %dx,(%eax)
        addr_6845 = CGA_BASE;
c0101735:	66 c7 05 26 55 12 c0 	movw   $0x3d4,0xc0125526
c010173c:	d4 03 
    }

    // Extract cursor location
    uint32_t pos;
    outb(addr_6845, 14);
c010173e:	0f b7 05 26 55 12 c0 	movzwl 0xc0125526,%eax
c0101745:	0f b7 c0             	movzwl %ax,%eax
c0101748:	66 89 45 e6          	mov    %ax,-0x1a(%ebp)
c010174c:	c6 45 e5 0e          	movb   $0xe,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101750:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c0101754:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c0101758:	ee                   	out    %al,(%dx)
}
c0101759:	90                   	nop
    pos = inb(addr_6845 + 1) << 8;
c010175a:	0f b7 05 26 55 12 c0 	movzwl 0xc0125526,%eax
c0101761:	83 c0 01             	add    $0x1,%eax
c0101764:	0f b7 c0             	movzwl %ax,%eax
c0101767:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c010176b:	0f b7 45 ea          	movzwl -0x16(%ebp),%eax
c010176f:	89 c2                	mov    %eax,%edx
c0101771:	ec                   	in     (%dx),%al
c0101772:	88 45 e9             	mov    %al,-0x17(%ebp)
    return data;
c0101775:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c0101779:	0f b6 c0             	movzbl %al,%eax
c010177c:	c1 e0 08             	shl    $0x8,%eax
c010177f:	89 45 f4             	mov    %eax,-0xc(%ebp)
    outb(addr_6845, 15);
c0101782:	0f b7 05 26 55 12 c0 	movzwl 0xc0125526,%eax
c0101789:	0f b7 c0             	movzwl %ax,%eax
c010178c:	66 89 45 ee          	mov    %ax,-0x12(%ebp)
c0101790:	c6 45 ed 0f          	movb   $0xf,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101794:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101798:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c010179c:	ee                   	out    %al,(%dx)
}
c010179d:	90                   	nop
    pos |= inb(addr_6845 + 1);
c010179e:	0f b7 05 26 55 12 c0 	movzwl 0xc0125526,%eax
c01017a5:	83 c0 01             	add    $0x1,%eax
c01017a8:	0f b7 c0             	movzwl %ax,%eax
c01017ab:	66 89 45 f2          	mov    %ax,-0xe(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c01017af:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c01017b3:	89 c2                	mov    %eax,%edx
c01017b5:	ec                   	in     (%dx),%al
c01017b6:	88 45 f1             	mov    %al,-0xf(%ebp)
    return data;
c01017b9:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c01017bd:	0f b6 c0             	movzbl %al,%eax
c01017c0:	09 45 f4             	or     %eax,-0xc(%ebp)

    crt_buf = (uint16_t*) cp;
c01017c3:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01017c6:	a3 20 55 12 c0       	mov    %eax,0xc0125520
    crt_pos = pos;
c01017cb:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01017ce:	66 a3 24 55 12 c0    	mov    %ax,0xc0125524
}
c01017d4:	90                   	nop
c01017d5:	c9                   	leave  
c01017d6:	c3                   	ret    

c01017d7 <serial_init>:

static bool serial_exists = 0;

static void
serial_init(void) {
c01017d7:	f3 0f 1e fb          	endbr32 
c01017db:	55                   	push   %ebp
c01017dc:	89 e5                	mov    %esp,%ebp
c01017de:	83 ec 38             	sub    $0x38,%esp
c01017e1:	66 c7 45 d2 fa 03    	movw   $0x3fa,-0x2e(%ebp)
c01017e7:	c6 45 d1 00          	movb   $0x0,-0x2f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01017eb:	0f b6 45 d1          	movzbl -0x2f(%ebp),%eax
c01017ef:	0f b7 55 d2          	movzwl -0x2e(%ebp),%edx
c01017f3:	ee                   	out    %al,(%dx)
}
c01017f4:	90                   	nop
c01017f5:	66 c7 45 d6 fb 03    	movw   $0x3fb,-0x2a(%ebp)
c01017fb:	c6 45 d5 80          	movb   $0x80,-0x2b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01017ff:	0f b6 45 d5          	movzbl -0x2b(%ebp),%eax
c0101803:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
c0101807:	ee                   	out    %al,(%dx)
}
c0101808:	90                   	nop
c0101809:	66 c7 45 da f8 03    	movw   $0x3f8,-0x26(%ebp)
c010180f:	c6 45 d9 0c          	movb   $0xc,-0x27(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101813:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
c0101817:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
c010181b:	ee                   	out    %al,(%dx)
}
c010181c:	90                   	nop
c010181d:	66 c7 45 de f9 03    	movw   $0x3f9,-0x22(%ebp)
c0101823:	c6 45 dd 00          	movb   $0x0,-0x23(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101827:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
c010182b:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
c010182f:	ee                   	out    %al,(%dx)
}
c0101830:	90                   	nop
c0101831:	66 c7 45 e2 fb 03    	movw   $0x3fb,-0x1e(%ebp)
c0101837:	c6 45 e1 03          	movb   $0x3,-0x1f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010183b:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
c010183f:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
c0101843:	ee                   	out    %al,(%dx)
}
c0101844:	90                   	nop
c0101845:	66 c7 45 e6 fc 03    	movw   $0x3fc,-0x1a(%ebp)
c010184b:	c6 45 e5 00          	movb   $0x0,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010184f:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c0101853:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c0101857:	ee                   	out    %al,(%dx)
}
c0101858:	90                   	nop
c0101859:	66 c7 45 ea f9 03    	movw   $0x3f9,-0x16(%ebp)
c010185f:	c6 45 e9 01          	movb   $0x1,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101863:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c0101867:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c010186b:	ee                   	out    %al,(%dx)
}
c010186c:	90                   	nop
c010186d:	66 c7 45 ee fd 03    	movw   $0x3fd,-0x12(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0101873:	0f b7 45 ee          	movzwl -0x12(%ebp),%eax
c0101877:	89 c2                	mov    %eax,%edx
c0101879:	ec                   	in     (%dx),%al
c010187a:	88 45 ed             	mov    %al,-0x13(%ebp)
    return data;
c010187d:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
    // Enable rcv interrupts
    outb(COM1 + COM_IER, COM_IER_RDI);

    // Clear any preexisting overrun indications and interrupts
    // Serial port doesn't exist if COM_LSR returns 0xFF
    serial_exists = (inb(COM1 + COM_LSR) != 0xFF);
c0101881:	3c ff                	cmp    $0xff,%al
c0101883:	0f 95 c0             	setne  %al
c0101886:	0f b6 c0             	movzbl %al,%eax
c0101889:	a3 28 55 12 c0       	mov    %eax,0xc0125528
c010188e:	66 c7 45 f2 fa 03    	movw   $0x3fa,-0xe(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0101894:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c0101898:	89 c2                	mov    %eax,%edx
c010189a:	ec                   	in     (%dx),%al
c010189b:	88 45 f1             	mov    %al,-0xf(%ebp)
c010189e:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
c01018a4:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c01018a8:	89 c2                	mov    %eax,%edx
c01018aa:	ec                   	in     (%dx),%al
c01018ab:	88 45 f5             	mov    %al,-0xb(%ebp)
    (void) inb(COM1+COM_IIR);
    (void) inb(COM1+COM_RX);

    if (serial_exists) {
c01018ae:	a1 28 55 12 c0       	mov    0xc0125528,%eax
c01018b3:	85 c0                	test   %eax,%eax
c01018b5:	74 0d                	je     c01018c4 <serial_init+0xed>
        pic_enable(IRQ_COM1);
c01018b7:	83 ec 0c             	sub    $0xc,%esp
c01018ba:	6a 04                	push   $0x4
c01018bc:	e8 3e 07 00 00       	call   c0101fff <pic_enable>
c01018c1:	83 c4 10             	add    $0x10,%esp
    }
}
c01018c4:	90                   	nop
c01018c5:	c9                   	leave  
c01018c6:	c3                   	ret    

c01018c7 <lpt_putc_sub>:

static void
lpt_putc_sub(int c) {
c01018c7:	f3 0f 1e fb          	endbr32 
c01018cb:	55                   	push   %ebp
c01018cc:	89 e5                	mov    %esp,%ebp
c01018ce:	83 ec 20             	sub    $0x20,%esp
    int i;
    for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
c01018d1:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
c01018d8:	eb 09                	jmp    c01018e3 <lpt_putc_sub+0x1c>
        delay();
c01018da:	e8 be fd ff ff       	call   c010169d <delay>
    for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
c01018df:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
c01018e3:	66 c7 45 fa 79 03    	movw   $0x379,-0x6(%ebp)
c01018e9:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
c01018ed:	89 c2                	mov    %eax,%edx
c01018ef:	ec                   	in     (%dx),%al
c01018f0:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
c01018f3:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c01018f7:	84 c0                	test   %al,%al
c01018f9:	78 09                	js     c0101904 <lpt_putc_sub+0x3d>
c01018fb:	81 7d fc ff 31 00 00 	cmpl   $0x31ff,-0x4(%ebp)
c0101902:	7e d6                	jle    c01018da <lpt_putc_sub+0x13>
    }
    outb(LPTPORT + 0, c);
c0101904:	8b 45 08             	mov    0x8(%ebp),%eax
c0101907:	0f b6 c0             	movzbl %al,%eax
c010190a:	66 c7 45 ee 78 03    	movw   $0x378,-0x12(%ebp)
c0101910:	88 45 ed             	mov    %al,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101913:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101917:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c010191b:	ee                   	out    %al,(%dx)
}
c010191c:	90                   	nop
c010191d:	66 c7 45 f2 7a 03    	movw   $0x37a,-0xe(%ebp)
c0101923:	c6 45 f1 0d          	movb   $0xd,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101927:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c010192b:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c010192f:	ee                   	out    %al,(%dx)
}
c0101930:	90                   	nop
c0101931:	66 c7 45 f6 7a 03    	movw   $0x37a,-0xa(%ebp)
c0101937:	c6 45 f5 08          	movb   $0x8,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010193b:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c010193f:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c0101943:	ee                   	out    %al,(%dx)
}
c0101944:	90                   	nop
    outb(LPTPORT + 2, 0x08 | 0x04 | 0x01);
    outb(LPTPORT + 2, 0x08);
}
c0101945:	90                   	nop
c0101946:	c9                   	leave  
c0101947:	c3                   	ret    

c0101948 <lpt_putc>:

/* lpt_putc - copy console output to parallel port */
static void
lpt_putc(int c) {
c0101948:	f3 0f 1e fb          	endbr32 
c010194c:	55                   	push   %ebp
c010194d:	89 e5                	mov    %esp,%ebp
    if (c != '\b') {
c010194f:	83 7d 08 08          	cmpl   $0x8,0x8(%ebp)
c0101953:	74 0d                	je     c0101962 <lpt_putc+0x1a>
        lpt_putc_sub(c);
c0101955:	ff 75 08             	pushl  0x8(%ebp)
c0101958:	e8 6a ff ff ff       	call   c01018c7 <lpt_putc_sub>
c010195d:	83 c4 04             	add    $0x4,%esp
    else {
        lpt_putc_sub('\b');
        lpt_putc_sub(' ');
        lpt_putc_sub('\b');
    }
}
c0101960:	eb 1e                	jmp    c0101980 <lpt_putc+0x38>
        lpt_putc_sub('\b');
c0101962:	6a 08                	push   $0x8
c0101964:	e8 5e ff ff ff       	call   c01018c7 <lpt_putc_sub>
c0101969:	83 c4 04             	add    $0x4,%esp
        lpt_putc_sub(' ');
c010196c:	6a 20                	push   $0x20
c010196e:	e8 54 ff ff ff       	call   c01018c7 <lpt_putc_sub>
c0101973:	83 c4 04             	add    $0x4,%esp
        lpt_putc_sub('\b');
c0101976:	6a 08                	push   $0x8
c0101978:	e8 4a ff ff ff       	call   c01018c7 <lpt_putc_sub>
c010197d:	83 c4 04             	add    $0x4,%esp
}
c0101980:	90                   	nop
c0101981:	c9                   	leave  
c0101982:	c3                   	ret    

c0101983 <cga_putc>:

/* cga_putc - print character to console */
static void
cga_putc(int c) {
c0101983:	f3 0f 1e fb          	endbr32 
c0101987:	55                   	push   %ebp
c0101988:	89 e5                	mov    %esp,%ebp
c010198a:	53                   	push   %ebx
c010198b:	83 ec 24             	sub    $0x24,%esp
    // set black on white
    if (!(c & ~0xFF)) {
c010198e:	8b 45 08             	mov    0x8(%ebp),%eax
c0101991:	b0 00                	mov    $0x0,%al
c0101993:	85 c0                	test   %eax,%eax
c0101995:	75 07                	jne    c010199e <cga_putc+0x1b>
        c |= 0x0700;
c0101997:	81 4d 08 00 07 00 00 	orl    $0x700,0x8(%ebp)
    }

    switch (c & 0xff) {
c010199e:	8b 45 08             	mov    0x8(%ebp),%eax
c01019a1:	0f b6 c0             	movzbl %al,%eax
c01019a4:	83 f8 0d             	cmp    $0xd,%eax
c01019a7:	74 6c                	je     c0101a15 <cga_putc+0x92>
c01019a9:	83 f8 0d             	cmp    $0xd,%eax
c01019ac:	0f 8f 9d 00 00 00    	jg     c0101a4f <cga_putc+0xcc>
c01019b2:	83 f8 08             	cmp    $0x8,%eax
c01019b5:	74 0a                	je     c01019c1 <cga_putc+0x3e>
c01019b7:	83 f8 0a             	cmp    $0xa,%eax
c01019ba:	74 49                	je     c0101a05 <cga_putc+0x82>
c01019bc:	e9 8e 00 00 00       	jmp    c0101a4f <cga_putc+0xcc>
    case '\b':
        if (crt_pos > 0) {
c01019c1:	0f b7 05 24 55 12 c0 	movzwl 0xc0125524,%eax
c01019c8:	66 85 c0             	test   %ax,%ax
c01019cb:	0f 84 a4 00 00 00    	je     c0101a75 <cga_putc+0xf2>
            crt_pos --;
c01019d1:	0f b7 05 24 55 12 c0 	movzwl 0xc0125524,%eax
c01019d8:	83 e8 01             	sub    $0x1,%eax
c01019db:	66 a3 24 55 12 c0    	mov    %ax,0xc0125524
            crt_buf[crt_pos] = (c & ~0xff) | ' ';
c01019e1:	8b 45 08             	mov    0x8(%ebp),%eax
c01019e4:	b0 00                	mov    $0x0,%al
c01019e6:	83 c8 20             	or     $0x20,%eax
c01019e9:	89 c1                	mov    %eax,%ecx
c01019eb:	a1 20 55 12 c0       	mov    0xc0125520,%eax
c01019f0:	0f b7 15 24 55 12 c0 	movzwl 0xc0125524,%edx
c01019f7:	0f b7 d2             	movzwl %dx,%edx
c01019fa:	01 d2                	add    %edx,%edx
c01019fc:	01 d0                	add    %edx,%eax
c01019fe:	89 ca                	mov    %ecx,%edx
c0101a00:	66 89 10             	mov    %dx,(%eax)
        }
        break;
c0101a03:	eb 70                	jmp    c0101a75 <cga_putc+0xf2>
    case '\n':
        crt_pos += CRT_COLS;
c0101a05:	0f b7 05 24 55 12 c0 	movzwl 0xc0125524,%eax
c0101a0c:	83 c0 50             	add    $0x50,%eax
c0101a0f:	66 a3 24 55 12 c0    	mov    %ax,0xc0125524
    case '\r':
        crt_pos -= (crt_pos % CRT_COLS);
c0101a15:	0f b7 1d 24 55 12 c0 	movzwl 0xc0125524,%ebx
c0101a1c:	0f b7 0d 24 55 12 c0 	movzwl 0xc0125524,%ecx
c0101a23:	0f b7 c1             	movzwl %cx,%eax
c0101a26:	69 c0 cd cc 00 00    	imul   $0xcccd,%eax,%eax
c0101a2c:	c1 e8 10             	shr    $0x10,%eax
c0101a2f:	89 c2                	mov    %eax,%edx
c0101a31:	66 c1 ea 06          	shr    $0x6,%dx
c0101a35:	89 d0                	mov    %edx,%eax
c0101a37:	c1 e0 02             	shl    $0x2,%eax
c0101a3a:	01 d0                	add    %edx,%eax
c0101a3c:	c1 e0 04             	shl    $0x4,%eax
c0101a3f:	29 c1                	sub    %eax,%ecx
c0101a41:	89 ca                	mov    %ecx,%edx
c0101a43:	89 d8                	mov    %ebx,%eax
c0101a45:	29 d0                	sub    %edx,%eax
c0101a47:	66 a3 24 55 12 c0    	mov    %ax,0xc0125524
        break;
c0101a4d:	eb 27                	jmp    c0101a76 <cga_putc+0xf3>
    default:
        crt_buf[crt_pos ++] = c;     // write the character
c0101a4f:	8b 0d 20 55 12 c0    	mov    0xc0125520,%ecx
c0101a55:	0f b7 05 24 55 12 c0 	movzwl 0xc0125524,%eax
c0101a5c:	8d 50 01             	lea    0x1(%eax),%edx
c0101a5f:	66 89 15 24 55 12 c0 	mov    %dx,0xc0125524
c0101a66:	0f b7 c0             	movzwl %ax,%eax
c0101a69:	01 c0                	add    %eax,%eax
c0101a6b:	01 c8                	add    %ecx,%eax
c0101a6d:	8b 55 08             	mov    0x8(%ebp),%edx
c0101a70:	66 89 10             	mov    %dx,(%eax)
        break;
c0101a73:	eb 01                	jmp    c0101a76 <cga_putc+0xf3>
        break;
c0101a75:	90                   	nop
    }

    // What is the purpose of this?
    if (crt_pos >= CRT_SIZE) {
c0101a76:	0f b7 05 24 55 12 c0 	movzwl 0xc0125524,%eax
c0101a7d:	66 3d cf 07          	cmp    $0x7cf,%ax
c0101a81:	76 59                	jbe    c0101adc <cga_putc+0x159>
        int i;
        memmove(crt_buf, crt_buf + CRT_COLS, (CRT_SIZE - CRT_COLS) * sizeof(uint16_t));
c0101a83:	a1 20 55 12 c0       	mov    0xc0125520,%eax
c0101a88:	8d 90 a0 00 00 00    	lea    0xa0(%eax),%edx
c0101a8e:	a1 20 55 12 c0       	mov    0xc0125520,%eax
c0101a93:	83 ec 04             	sub    $0x4,%esp
c0101a96:	68 00 0f 00 00       	push   $0xf00
c0101a9b:	52                   	push   %edx
c0101a9c:	50                   	push   %eax
c0101a9d:	e8 72 61 00 00       	call   c0107c14 <memmove>
c0101aa2:	83 c4 10             	add    $0x10,%esp
        for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
c0101aa5:	c7 45 f4 80 07 00 00 	movl   $0x780,-0xc(%ebp)
c0101aac:	eb 15                	jmp    c0101ac3 <cga_putc+0x140>
            crt_buf[i] = 0x0700 | ' ';
c0101aae:	a1 20 55 12 c0       	mov    0xc0125520,%eax
c0101ab3:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0101ab6:	01 d2                	add    %edx,%edx
c0101ab8:	01 d0                	add    %edx,%eax
c0101aba:	66 c7 00 20 07       	movw   $0x720,(%eax)
        for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
c0101abf:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c0101ac3:	81 7d f4 cf 07 00 00 	cmpl   $0x7cf,-0xc(%ebp)
c0101aca:	7e e2                	jle    c0101aae <cga_putc+0x12b>
        }
        crt_pos -= CRT_COLS;
c0101acc:	0f b7 05 24 55 12 c0 	movzwl 0xc0125524,%eax
c0101ad3:	83 e8 50             	sub    $0x50,%eax
c0101ad6:	66 a3 24 55 12 c0    	mov    %ax,0xc0125524
    }

    // move that little blinky thing
    outb(addr_6845, 14);
c0101adc:	0f b7 05 26 55 12 c0 	movzwl 0xc0125526,%eax
c0101ae3:	0f b7 c0             	movzwl %ax,%eax
c0101ae6:	66 89 45 e6          	mov    %ax,-0x1a(%ebp)
c0101aea:	c6 45 e5 0e          	movb   $0xe,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101aee:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c0101af2:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c0101af6:	ee                   	out    %al,(%dx)
}
c0101af7:	90                   	nop
    outb(addr_6845 + 1, crt_pos >> 8);
c0101af8:	0f b7 05 24 55 12 c0 	movzwl 0xc0125524,%eax
c0101aff:	66 c1 e8 08          	shr    $0x8,%ax
c0101b03:	0f b6 c0             	movzbl %al,%eax
c0101b06:	0f b7 15 26 55 12 c0 	movzwl 0xc0125526,%edx
c0101b0d:	83 c2 01             	add    $0x1,%edx
c0101b10:	0f b7 d2             	movzwl %dx,%edx
c0101b13:	66 89 55 ea          	mov    %dx,-0x16(%ebp)
c0101b17:	88 45 e9             	mov    %al,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101b1a:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c0101b1e:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c0101b22:	ee                   	out    %al,(%dx)
}
c0101b23:	90                   	nop
    outb(addr_6845, 15);
c0101b24:	0f b7 05 26 55 12 c0 	movzwl 0xc0125526,%eax
c0101b2b:	0f b7 c0             	movzwl %ax,%eax
c0101b2e:	66 89 45 ee          	mov    %ax,-0x12(%ebp)
c0101b32:	c6 45 ed 0f          	movb   $0xf,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101b36:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101b3a:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c0101b3e:	ee                   	out    %al,(%dx)
}
c0101b3f:	90                   	nop
    outb(addr_6845 + 1, crt_pos);
c0101b40:	0f b7 05 24 55 12 c0 	movzwl 0xc0125524,%eax
c0101b47:	0f b6 c0             	movzbl %al,%eax
c0101b4a:	0f b7 15 26 55 12 c0 	movzwl 0xc0125526,%edx
c0101b51:	83 c2 01             	add    $0x1,%edx
c0101b54:	0f b7 d2             	movzwl %dx,%edx
c0101b57:	66 89 55 f2          	mov    %dx,-0xe(%ebp)
c0101b5b:	88 45 f1             	mov    %al,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101b5e:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c0101b62:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c0101b66:	ee                   	out    %al,(%dx)
}
c0101b67:	90                   	nop
}
c0101b68:	90                   	nop
c0101b69:	8b 5d fc             	mov    -0x4(%ebp),%ebx
c0101b6c:	c9                   	leave  
c0101b6d:	c3                   	ret    

c0101b6e <serial_putc_sub>:

static void
serial_putc_sub(int c) {
c0101b6e:	f3 0f 1e fb          	endbr32 
c0101b72:	55                   	push   %ebp
c0101b73:	89 e5                	mov    %esp,%ebp
c0101b75:	83 ec 10             	sub    $0x10,%esp
    int i;
    for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
c0101b78:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
c0101b7f:	eb 09                	jmp    c0101b8a <serial_putc_sub+0x1c>
        delay();
c0101b81:	e8 17 fb ff ff       	call   c010169d <delay>
    for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
c0101b86:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
c0101b8a:	66 c7 45 fa fd 03    	movw   $0x3fd,-0x6(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0101b90:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
c0101b94:	89 c2                	mov    %eax,%edx
c0101b96:	ec                   	in     (%dx),%al
c0101b97:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
c0101b9a:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c0101b9e:	0f b6 c0             	movzbl %al,%eax
c0101ba1:	83 e0 20             	and    $0x20,%eax
c0101ba4:	85 c0                	test   %eax,%eax
c0101ba6:	75 09                	jne    c0101bb1 <serial_putc_sub+0x43>
c0101ba8:	81 7d fc ff 31 00 00 	cmpl   $0x31ff,-0x4(%ebp)
c0101baf:	7e d0                	jle    c0101b81 <serial_putc_sub+0x13>
    }
    outb(COM1 + COM_TX, c);
c0101bb1:	8b 45 08             	mov    0x8(%ebp),%eax
c0101bb4:	0f b6 c0             	movzbl %al,%eax
c0101bb7:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
c0101bbd:	88 45 f5             	mov    %al,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101bc0:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c0101bc4:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c0101bc8:	ee                   	out    %al,(%dx)
}
c0101bc9:	90                   	nop
}
c0101bca:	90                   	nop
c0101bcb:	c9                   	leave  
c0101bcc:	c3                   	ret    

c0101bcd <serial_putc>:

/* serial_putc - print character to serial port */
static void
serial_putc(int c) {
c0101bcd:	f3 0f 1e fb          	endbr32 
c0101bd1:	55                   	push   %ebp
c0101bd2:	89 e5                	mov    %esp,%ebp
    if (c != '\b') {
c0101bd4:	83 7d 08 08          	cmpl   $0x8,0x8(%ebp)
c0101bd8:	74 0d                	je     c0101be7 <serial_putc+0x1a>
        serial_putc_sub(c);
c0101bda:	ff 75 08             	pushl  0x8(%ebp)
c0101bdd:	e8 8c ff ff ff       	call   c0101b6e <serial_putc_sub>
c0101be2:	83 c4 04             	add    $0x4,%esp
    else {
        serial_putc_sub('\b');
        serial_putc_sub(' ');
        serial_putc_sub('\b');
    }
}
c0101be5:	eb 1e                	jmp    c0101c05 <serial_putc+0x38>
        serial_putc_sub('\b');
c0101be7:	6a 08                	push   $0x8
c0101be9:	e8 80 ff ff ff       	call   c0101b6e <serial_putc_sub>
c0101bee:	83 c4 04             	add    $0x4,%esp
        serial_putc_sub(' ');
c0101bf1:	6a 20                	push   $0x20
c0101bf3:	e8 76 ff ff ff       	call   c0101b6e <serial_putc_sub>
c0101bf8:	83 c4 04             	add    $0x4,%esp
        serial_putc_sub('\b');
c0101bfb:	6a 08                	push   $0x8
c0101bfd:	e8 6c ff ff ff       	call   c0101b6e <serial_putc_sub>
c0101c02:	83 c4 04             	add    $0x4,%esp
}
c0101c05:	90                   	nop
c0101c06:	c9                   	leave  
c0101c07:	c3                   	ret    

c0101c08 <cons_intr>:
/* *
 * cons_intr - called by device interrupt routines to feed input
 * characters into the circular console input buffer.
 * */
static void
cons_intr(int (*proc)(void)) {
c0101c08:	f3 0f 1e fb          	endbr32 
c0101c0c:	55                   	push   %ebp
c0101c0d:	89 e5                	mov    %esp,%ebp
c0101c0f:	83 ec 18             	sub    $0x18,%esp
    int c;
    while ((c = (*proc)()) != -1) {
c0101c12:	eb 33                	jmp    c0101c47 <cons_intr+0x3f>
        if (c != 0) {
c0101c14:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0101c18:	74 2d                	je     c0101c47 <cons_intr+0x3f>
            cons.buf[cons.wpos ++] = c;
c0101c1a:	a1 44 57 12 c0       	mov    0xc0125744,%eax
c0101c1f:	8d 50 01             	lea    0x1(%eax),%edx
c0101c22:	89 15 44 57 12 c0    	mov    %edx,0xc0125744
c0101c28:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0101c2b:	88 90 40 55 12 c0    	mov    %dl,-0x3fedaac0(%eax)
            if (cons.wpos == CONSBUFSIZE) {
c0101c31:	a1 44 57 12 c0       	mov    0xc0125744,%eax
c0101c36:	3d 00 02 00 00       	cmp    $0x200,%eax
c0101c3b:	75 0a                	jne    c0101c47 <cons_intr+0x3f>
                cons.wpos = 0;
c0101c3d:	c7 05 44 57 12 c0 00 	movl   $0x0,0xc0125744
c0101c44:	00 00 00 
    while ((c = (*proc)()) != -1) {
c0101c47:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c4a:	ff d0                	call   *%eax
c0101c4c:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0101c4f:	83 7d f4 ff          	cmpl   $0xffffffff,-0xc(%ebp)
c0101c53:	75 bf                	jne    c0101c14 <cons_intr+0xc>
            }
        }
    }
}
c0101c55:	90                   	nop
c0101c56:	90                   	nop
c0101c57:	c9                   	leave  
c0101c58:	c3                   	ret    

c0101c59 <serial_proc_data>:

/* serial_proc_data - get data from serial port */
static int
serial_proc_data(void) {
c0101c59:	f3 0f 1e fb          	endbr32 
c0101c5d:	55                   	push   %ebp
c0101c5e:	89 e5                	mov    %esp,%ebp
c0101c60:	83 ec 10             	sub    $0x10,%esp
c0101c63:	66 c7 45 fa fd 03    	movw   $0x3fd,-0x6(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0101c69:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
c0101c6d:	89 c2                	mov    %eax,%edx
c0101c6f:	ec                   	in     (%dx),%al
c0101c70:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
c0101c73:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
    if (!(inb(COM1 + COM_LSR) & COM_LSR_DATA)) {
c0101c77:	0f b6 c0             	movzbl %al,%eax
c0101c7a:	83 e0 01             	and    $0x1,%eax
c0101c7d:	85 c0                	test   %eax,%eax
c0101c7f:	75 07                	jne    c0101c88 <serial_proc_data+0x2f>
        return -1;
c0101c81:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0101c86:	eb 2a                	jmp    c0101cb2 <serial_proc_data+0x59>
c0101c88:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0101c8e:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c0101c92:	89 c2                	mov    %eax,%edx
c0101c94:	ec                   	in     (%dx),%al
c0101c95:	88 45 f5             	mov    %al,-0xb(%ebp)
    return data;
c0101c98:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
    }
    int c = inb(COM1 + COM_RX);
c0101c9c:	0f b6 c0             	movzbl %al,%eax
c0101c9f:	89 45 fc             	mov    %eax,-0x4(%ebp)
    if (c == 127) {
c0101ca2:	83 7d fc 7f          	cmpl   $0x7f,-0x4(%ebp)
c0101ca6:	75 07                	jne    c0101caf <serial_proc_data+0x56>
        c = '\b';
c0101ca8:	c7 45 fc 08 00 00 00 	movl   $0x8,-0x4(%ebp)
    }
    return c;
c0101caf:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c0101cb2:	c9                   	leave  
c0101cb3:	c3                   	ret    

c0101cb4 <serial_intr>:

/* serial_intr - try to feed input characters from serial port */
void
serial_intr(void) {
c0101cb4:	f3 0f 1e fb          	endbr32 
c0101cb8:	55                   	push   %ebp
c0101cb9:	89 e5                	mov    %esp,%ebp
c0101cbb:	83 ec 08             	sub    $0x8,%esp
    if (serial_exists) {
c0101cbe:	a1 28 55 12 c0       	mov    0xc0125528,%eax
c0101cc3:	85 c0                	test   %eax,%eax
c0101cc5:	74 10                	je     c0101cd7 <serial_intr+0x23>
        cons_intr(serial_proc_data);
c0101cc7:	83 ec 0c             	sub    $0xc,%esp
c0101cca:	68 59 1c 10 c0       	push   $0xc0101c59
c0101ccf:	e8 34 ff ff ff       	call   c0101c08 <cons_intr>
c0101cd4:	83 c4 10             	add    $0x10,%esp
    }
}
c0101cd7:	90                   	nop
c0101cd8:	c9                   	leave  
c0101cd9:	c3                   	ret    

c0101cda <kbd_proc_data>:
 *
 * The kbd_proc_data() function gets data from the keyboard.
 * If we finish a character, return it, else 0. And return -1 if no data.
 * */
static int
kbd_proc_data(void) {
c0101cda:	f3 0f 1e fb          	endbr32 
c0101cde:	55                   	push   %ebp
c0101cdf:	89 e5                	mov    %esp,%ebp
c0101ce1:	83 ec 28             	sub    $0x28,%esp
c0101ce4:	66 c7 45 f0 64 00    	movw   $0x64,-0x10(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0101cea:	0f b7 45 f0          	movzwl -0x10(%ebp),%eax
c0101cee:	89 c2                	mov    %eax,%edx
c0101cf0:	ec                   	in     (%dx),%al
c0101cf1:	88 45 ef             	mov    %al,-0x11(%ebp)
    return data;
c0101cf4:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
    int c;
    uint8_t data;
    static uint32_t shift;

    if ((inb(KBSTATP) & KBS_DIB) == 0) {
c0101cf8:	0f b6 c0             	movzbl %al,%eax
c0101cfb:	83 e0 01             	and    $0x1,%eax
c0101cfe:	85 c0                	test   %eax,%eax
c0101d00:	75 0a                	jne    c0101d0c <kbd_proc_data+0x32>
        return -1;
c0101d02:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0101d07:	e9 5e 01 00 00       	jmp    c0101e6a <kbd_proc_data+0x190>
c0101d0c:	66 c7 45 ec 60 00    	movw   $0x60,-0x14(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0101d12:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
c0101d16:	89 c2                	mov    %eax,%edx
c0101d18:	ec                   	in     (%dx),%al
c0101d19:	88 45 eb             	mov    %al,-0x15(%ebp)
    return data;
c0101d1c:	0f b6 45 eb          	movzbl -0x15(%ebp),%eax
    }

    data = inb(KBDATAP);
c0101d20:	88 45 f3             	mov    %al,-0xd(%ebp)

    if (data == 0xE0) {
c0101d23:	80 7d f3 e0          	cmpb   $0xe0,-0xd(%ebp)
c0101d27:	75 17                	jne    c0101d40 <kbd_proc_data+0x66>
        // E0 escape character
        shift |= E0ESC;
c0101d29:	a1 48 57 12 c0       	mov    0xc0125748,%eax
c0101d2e:	83 c8 40             	or     $0x40,%eax
c0101d31:	a3 48 57 12 c0       	mov    %eax,0xc0125748
        return 0;
c0101d36:	b8 00 00 00 00       	mov    $0x0,%eax
c0101d3b:	e9 2a 01 00 00       	jmp    c0101e6a <kbd_proc_data+0x190>
    } else if (data & 0x80) {
c0101d40:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101d44:	84 c0                	test   %al,%al
c0101d46:	79 47                	jns    c0101d8f <kbd_proc_data+0xb5>
        // Key released
        data = (shift & E0ESC ? data : data & 0x7F);
c0101d48:	a1 48 57 12 c0       	mov    0xc0125748,%eax
c0101d4d:	83 e0 40             	and    $0x40,%eax
c0101d50:	85 c0                	test   %eax,%eax
c0101d52:	75 09                	jne    c0101d5d <kbd_proc_data+0x83>
c0101d54:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101d58:	83 e0 7f             	and    $0x7f,%eax
c0101d5b:	eb 04                	jmp    c0101d61 <kbd_proc_data+0x87>
c0101d5d:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101d61:	88 45 f3             	mov    %al,-0xd(%ebp)
        shift &= ~(shiftcode[data] | E0ESC);
c0101d64:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101d68:	0f b6 80 40 20 12 c0 	movzbl -0x3feddfc0(%eax),%eax
c0101d6f:	83 c8 40             	or     $0x40,%eax
c0101d72:	0f b6 c0             	movzbl %al,%eax
c0101d75:	f7 d0                	not    %eax
c0101d77:	89 c2                	mov    %eax,%edx
c0101d79:	a1 48 57 12 c0       	mov    0xc0125748,%eax
c0101d7e:	21 d0                	and    %edx,%eax
c0101d80:	a3 48 57 12 c0       	mov    %eax,0xc0125748
        return 0;
c0101d85:	b8 00 00 00 00       	mov    $0x0,%eax
c0101d8a:	e9 db 00 00 00       	jmp    c0101e6a <kbd_proc_data+0x190>
    } else if (shift & E0ESC) {
c0101d8f:	a1 48 57 12 c0       	mov    0xc0125748,%eax
c0101d94:	83 e0 40             	and    $0x40,%eax
c0101d97:	85 c0                	test   %eax,%eax
c0101d99:	74 11                	je     c0101dac <kbd_proc_data+0xd2>
        // Last character was an E0 escape; or with 0x80
        data |= 0x80;
c0101d9b:	80 4d f3 80          	orb    $0x80,-0xd(%ebp)
        shift &= ~E0ESC;
c0101d9f:	a1 48 57 12 c0       	mov    0xc0125748,%eax
c0101da4:	83 e0 bf             	and    $0xffffffbf,%eax
c0101da7:	a3 48 57 12 c0       	mov    %eax,0xc0125748
    }

    shift |= shiftcode[data];
c0101dac:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101db0:	0f b6 80 40 20 12 c0 	movzbl -0x3feddfc0(%eax),%eax
c0101db7:	0f b6 d0             	movzbl %al,%edx
c0101dba:	a1 48 57 12 c0       	mov    0xc0125748,%eax
c0101dbf:	09 d0                	or     %edx,%eax
c0101dc1:	a3 48 57 12 c0       	mov    %eax,0xc0125748
    shift ^= togglecode[data];
c0101dc6:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101dca:	0f b6 80 40 21 12 c0 	movzbl -0x3feddec0(%eax),%eax
c0101dd1:	0f b6 d0             	movzbl %al,%edx
c0101dd4:	a1 48 57 12 c0       	mov    0xc0125748,%eax
c0101dd9:	31 d0                	xor    %edx,%eax
c0101ddb:	a3 48 57 12 c0       	mov    %eax,0xc0125748

    c = charcode[shift & (CTL | SHIFT)][data];
c0101de0:	a1 48 57 12 c0       	mov    0xc0125748,%eax
c0101de5:	83 e0 03             	and    $0x3,%eax
c0101de8:	8b 14 85 40 25 12 c0 	mov    -0x3feddac0(,%eax,4),%edx
c0101def:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101df3:	01 d0                	add    %edx,%eax
c0101df5:	0f b6 00             	movzbl (%eax),%eax
c0101df8:	0f b6 c0             	movzbl %al,%eax
c0101dfb:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (shift & CAPSLOCK) {
c0101dfe:	a1 48 57 12 c0       	mov    0xc0125748,%eax
c0101e03:	83 e0 08             	and    $0x8,%eax
c0101e06:	85 c0                	test   %eax,%eax
c0101e08:	74 22                	je     c0101e2c <kbd_proc_data+0x152>
        if ('a' <= c && c <= 'z')
c0101e0a:	83 7d f4 60          	cmpl   $0x60,-0xc(%ebp)
c0101e0e:	7e 0c                	jle    c0101e1c <kbd_proc_data+0x142>
c0101e10:	83 7d f4 7a          	cmpl   $0x7a,-0xc(%ebp)
c0101e14:	7f 06                	jg     c0101e1c <kbd_proc_data+0x142>
            c += 'A' - 'a';
c0101e16:	83 6d f4 20          	subl   $0x20,-0xc(%ebp)
c0101e1a:	eb 10                	jmp    c0101e2c <kbd_proc_data+0x152>
        else if ('A' <= c && c <= 'Z')
c0101e1c:	83 7d f4 40          	cmpl   $0x40,-0xc(%ebp)
c0101e20:	7e 0a                	jle    c0101e2c <kbd_proc_data+0x152>
c0101e22:	83 7d f4 5a          	cmpl   $0x5a,-0xc(%ebp)
c0101e26:	7f 04                	jg     c0101e2c <kbd_proc_data+0x152>
            c += 'a' - 'A';
c0101e28:	83 45 f4 20          	addl   $0x20,-0xc(%ebp)
    }

    // Process special keys
    // Ctrl-Alt-Del: reboot
    if (!(~shift & (CTL | ALT)) && c == KEY_DEL) {
c0101e2c:	a1 48 57 12 c0       	mov    0xc0125748,%eax
c0101e31:	f7 d0                	not    %eax
c0101e33:	83 e0 06             	and    $0x6,%eax
c0101e36:	85 c0                	test   %eax,%eax
c0101e38:	75 2d                	jne    c0101e67 <kbd_proc_data+0x18d>
c0101e3a:	81 7d f4 e9 00 00 00 	cmpl   $0xe9,-0xc(%ebp)
c0101e41:	75 24                	jne    c0101e67 <kbd_proc_data+0x18d>
        cprintf("Rebooting!\n");
c0101e43:	83 ec 0c             	sub    $0xc,%esp
c0101e46:	68 a1 88 10 c0       	push   $0xc01088a1
c0101e4b:	e8 5a e4 ff ff       	call   c01002aa <cprintf>
c0101e50:	83 c4 10             	add    $0x10,%esp
c0101e53:	66 c7 45 e8 92 00    	movw   $0x92,-0x18(%ebp)
c0101e59:	c6 45 e7 03          	movb   $0x3,-0x19(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101e5d:	0f b6 45 e7          	movzbl -0x19(%ebp),%eax
c0101e61:	0f b7 55 e8          	movzwl -0x18(%ebp),%edx
c0101e65:	ee                   	out    %al,(%dx)
}
c0101e66:	90                   	nop
        outb(0x92, 0x3); // courtesy of Chris Frost
    }
    return c;
c0101e67:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0101e6a:	c9                   	leave  
c0101e6b:	c3                   	ret    

c0101e6c <kbd_intr>:

/* kbd_intr - try to feed input characters from keyboard */
static void
kbd_intr(void) {
c0101e6c:	f3 0f 1e fb          	endbr32 
c0101e70:	55                   	push   %ebp
c0101e71:	89 e5                	mov    %esp,%ebp
c0101e73:	83 ec 08             	sub    $0x8,%esp
    cons_intr(kbd_proc_data);
c0101e76:	83 ec 0c             	sub    $0xc,%esp
c0101e79:	68 da 1c 10 c0       	push   $0xc0101cda
c0101e7e:	e8 85 fd ff ff       	call   c0101c08 <cons_intr>
c0101e83:	83 c4 10             	add    $0x10,%esp
}
c0101e86:	90                   	nop
c0101e87:	c9                   	leave  
c0101e88:	c3                   	ret    

c0101e89 <kbd_init>:

static void
kbd_init(void) {
c0101e89:	f3 0f 1e fb          	endbr32 
c0101e8d:	55                   	push   %ebp
c0101e8e:	89 e5                	mov    %esp,%ebp
c0101e90:	83 ec 08             	sub    $0x8,%esp
    // drain the kbd buffer
    kbd_intr();
c0101e93:	e8 d4 ff ff ff       	call   c0101e6c <kbd_intr>
    pic_enable(IRQ_KBD);
c0101e98:	83 ec 0c             	sub    $0xc,%esp
c0101e9b:	6a 01                	push   $0x1
c0101e9d:	e8 5d 01 00 00       	call   c0101fff <pic_enable>
c0101ea2:	83 c4 10             	add    $0x10,%esp
}
c0101ea5:	90                   	nop
c0101ea6:	c9                   	leave  
c0101ea7:	c3                   	ret    

c0101ea8 <cons_init>:

/* cons_init - initializes the console devices */
void
cons_init(void) {
c0101ea8:	f3 0f 1e fb          	endbr32 
c0101eac:	55                   	push   %ebp
c0101ead:	89 e5                	mov    %esp,%ebp
c0101eaf:	83 ec 08             	sub    $0x8,%esp
    cga_init();
c0101eb2:	e8 33 f8 ff ff       	call   c01016ea <cga_init>
    serial_init();
c0101eb7:	e8 1b f9 ff ff       	call   c01017d7 <serial_init>
    kbd_init();
c0101ebc:	e8 c8 ff ff ff       	call   c0101e89 <kbd_init>
    if (!serial_exists) {
c0101ec1:	a1 28 55 12 c0       	mov    0xc0125528,%eax
c0101ec6:	85 c0                	test   %eax,%eax
c0101ec8:	75 10                	jne    c0101eda <cons_init+0x32>
        cprintf("serial port does not exist!!\n");
c0101eca:	83 ec 0c             	sub    $0xc,%esp
c0101ecd:	68 ad 88 10 c0       	push   $0xc01088ad
c0101ed2:	e8 d3 e3 ff ff       	call   c01002aa <cprintf>
c0101ed7:	83 c4 10             	add    $0x10,%esp
    }
}
c0101eda:	90                   	nop
c0101edb:	c9                   	leave  
c0101edc:	c3                   	ret    

c0101edd <cons_putc>:

/* cons_putc - print a single character @c to console devices */
void
cons_putc(int c) {
c0101edd:	f3 0f 1e fb          	endbr32 
c0101ee1:	55                   	push   %ebp
c0101ee2:	89 e5                	mov    %esp,%ebp
c0101ee4:	83 ec 18             	sub    $0x18,%esp
    bool intr_flag;
    local_intr_save(intr_flag);
c0101ee7:	e8 73 f7 ff ff       	call   c010165f <__intr_save>
c0101eec:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        lpt_putc(c);
c0101eef:	83 ec 0c             	sub    $0xc,%esp
c0101ef2:	ff 75 08             	pushl  0x8(%ebp)
c0101ef5:	e8 4e fa ff ff       	call   c0101948 <lpt_putc>
c0101efa:	83 c4 10             	add    $0x10,%esp
        cga_putc(c);
c0101efd:	83 ec 0c             	sub    $0xc,%esp
c0101f00:	ff 75 08             	pushl  0x8(%ebp)
c0101f03:	e8 7b fa ff ff       	call   c0101983 <cga_putc>
c0101f08:	83 c4 10             	add    $0x10,%esp
        serial_putc(c);
c0101f0b:	83 ec 0c             	sub    $0xc,%esp
c0101f0e:	ff 75 08             	pushl  0x8(%ebp)
c0101f11:	e8 b7 fc ff ff       	call   c0101bcd <serial_putc>
c0101f16:	83 c4 10             	add    $0x10,%esp
    }
    local_intr_restore(intr_flag);
c0101f19:	83 ec 0c             	sub    $0xc,%esp
c0101f1c:	ff 75 f4             	pushl  -0xc(%ebp)
c0101f1f:	e8 65 f7 ff ff       	call   c0101689 <__intr_restore>
c0101f24:	83 c4 10             	add    $0x10,%esp
}
c0101f27:	90                   	nop
c0101f28:	c9                   	leave  
c0101f29:	c3                   	ret    

c0101f2a <cons_getc>:
/* *
 * cons_getc - return the next input character from console,
 * or 0 if none waiting.
 * */
int
cons_getc(void) {
c0101f2a:	f3 0f 1e fb          	endbr32 
c0101f2e:	55                   	push   %ebp
c0101f2f:	89 e5                	mov    %esp,%ebp
c0101f31:	83 ec 18             	sub    $0x18,%esp
    int c = 0;
c0101f34:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    bool intr_flag;
    local_intr_save(intr_flag);
c0101f3b:	e8 1f f7 ff ff       	call   c010165f <__intr_save>
c0101f40:	89 45 f0             	mov    %eax,-0x10(%ebp)
    {
        // poll for any pending input characters,
        // so that this function works even when interrupts are disabled
        // (e.g., when called from the kernel monitor).
        serial_intr();
c0101f43:	e8 6c fd ff ff       	call   c0101cb4 <serial_intr>
        kbd_intr();
c0101f48:	e8 1f ff ff ff       	call   c0101e6c <kbd_intr>

        // grab the next character from the input buffer.
        if (cons.rpos != cons.wpos) {
c0101f4d:	8b 15 40 57 12 c0    	mov    0xc0125740,%edx
c0101f53:	a1 44 57 12 c0       	mov    0xc0125744,%eax
c0101f58:	39 c2                	cmp    %eax,%edx
c0101f5a:	74 31                	je     c0101f8d <cons_getc+0x63>
            c = cons.buf[cons.rpos ++];
c0101f5c:	a1 40 57 12 c0       	mov    0xc0125740,%eax
c0101f61:	8d 50 01             	lea    0x1(%eax),%edx
c0101f64:	89 15 40 57 12 c0    	mov    %edx,0xc0125740
c0101f6a:	0f b6 80 40 55 12 c0 	movzbl -0x3fedaac0(%eax),%eax
c0101f71:	0f b6 c0             	movzbl %al,%eax
c0101f74:	89 45 f4             	mov    %eax,-0xc(%ebp)
            if (cons.rpos == CONSBUFSIZE) {
c0101f77:	a1 40 57 12 c0       	mov    0xc0125740,%eax
c0101f7c:	3d 00 02 00 00       	cmp    $0x200,%eax
c0101f81:	75 0a                	jne    c0101f8d <cons_getc+0x63>
                cons.rpos = 0;
c0101f83:	c7 05 40 57 12 c0 00 	movl   $0x0,0xc0125740
c0101f8a:	00 00 00 
            }
        }
    }
    local_intr_restore(intr_flag);
c0101f8d:	83 ec 0c             	sub    $0xc,%esp
c0101f90:	ff 75 f0             	pushl  -0x10(%ebp)
c0101f93:	e8 f1 f6 ff ff       	call   c0101689 <__intr_restore>
c0101f98:	83 c4 10             	add    $0x10,%esp
    return c;
c0101f9b:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0101f9e:	c9                   	leave  
c0101f9f:	c3                   	ret    

c0101fa0 <pic_setmask>:
// Initial IRQ mask has interrupt 2 enabled (for slave 8259A).
static uint16_t irq_mask = 0xFFFF & ~(1 << IRQ_SLAVE);
static bool did_init = 0;

static void
pic_setmask(uint16_t mask) {
c0101fa0:	f3 0f 1e fb          	endbr32 
c0101fa4:	55                   	push   %ebp
c0101fa5:	89 e5                	mov    %esp,%ebp
c0101fa7:	83 ec 14             	sub    $0x14,%esp
c0101faa:	8b 45 08             	mov    0x8(%ebp),%eax
c0101fad:	66 89 45 ec          	mov    %ax,-0x14(%ebp)
    irq_mask = mask;
c0101fb1:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
c0101fb5:	66 a3 50 25 12 c0    	mov    %ax,0xc0122550
    if (did_init) {
c0101fbb:	a1 4c 57 12 c0       	mov    0xc012574c,%eax
c0101fc0:	85 c0                	test   %eax,%eax
c0101fc2:	74 38                	je     c0101ffc <pic_setmask+0x5c>
        outb(IO_PIC1 + 1, mask);
c0101fc4:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
c0101fc8:	0f b6 c0             	movzbl %al,%eax
c0101fcb:	66 c7 45 fa 21 00    	movw   $0x21,-0x6(%ebp)
c0101fd1:	88 45 f9             	mov    %al,-0x7(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101fd4:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c0101fd8:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
c0101fdc:	ee                   	out    %al,(%dx)
}
c0101fdd:	90                   	nop
        outb(IO_PIC2 + 1, mask >> 8);
c0101fde:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
c0101fe2:	66 c1 e8 08          	shr    $0x8,%ax
c0101fe6:	0f b6 c0             	movzbl %al,%eax
c0101fe9:	66 c7 45 fe a1 00    	movw   $0xa1,-0x2(%ebp)
c0101fef:	88 45 fd             	mov    %al,-0x3(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101ff2:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
c0101ff6:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
c0101ffa:	ee                   	out    %al,(%dx)
}
c0101ffb:	90                   	nop
    }
}
c0101ffc:	90                   	nop
c0101ffd:	c9                   	leave  
c0101ffe:	c3                   	ret    

c0101fff <pic_enable>:

void
pic_enable(unsigned int irq) {
c0101fff:	f3 0f 1e fb          	endbr32 
c0102003:	55                   	push   %ebp
c0102004:	89 e5                	mov    %esp,%ebp
    pic_setmask(irq_mask & ~(1 << irq));
c0102006:	8b 45 08             	mov    0x8(%ebp),%eax
c0102009:	ba 01 00 00 00       	mov    $0x1,%edx
c010200e:	89 c1                	mov    %eax,%ecx
c0102010:	d3 e2                	shl    %cl,%edx
c0102012:	89 d0                	mov    %edx,%eax
c0102014:	f7 d0                	not    %eax
c0102016:	89 c2                	mov    %eax,%edx
c0102018:	0f b7 05 50 25 12 c0 	movzwl 0xc0122550,%eax
c010201f:	21 d0                	and    %edx,%eax
c0102021:	0f b7 c0             	movzwl %ax,%eax
c0102024:	50                   	push   %eax
c0102025:	e8 76 ff ff ff       	call   c0101fa0 <pic_setmask>
c010202a:	83 c4 04             	add    $0x4,%esp
}
c010202d:	90                   	nop
c010202e:	c9                   	leave  
c010202f:	c3                   	ret    

c0102030 <pic_init>:

/* pic_init - initialize the 8259A interrupt controllers */
void
pic_init(void) {
c0102030:	f3 0f 1e fb          	endbr32 
c0102034:	55                   	push   %ebp
c0102035:	89 e5                	mov    %esp,%ebp
c0102037:	83 ec 40             	sub    $0x40,%esp
    did_init = 1;
c010203a:	c7 05 4c 57 12 c0 01 	movl   $0x1,0xc012574c
c0102041:	00 00 00 
c0102044:	66 c7 45 ca 21 00    	movw   $0x21,-0x36(%ebp)
c010204a:	c6 45 c9 ff          	movb   $0xff,-0x37(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010204e:	0f b6 45 c9          	movzbl -0x37(%ebp),%eax
c0102052:	0f b7 55 ca          	movzwl -0x36(%ebp),%edx
c0102056:	ee                   	out    %al,(%dx)
}
c0102057:	90                   	nop
c0102058:	66 c7 45 ce a1 00    	movw   $0xa1,-0x32(%ebp)
c010205e:	c6 45 cd ff          	movb   $0xff,-0x33(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0102062:	0f b6 45 cd          	movzbl -0x33(%ebp),%eax
c0102066:	0f b7 55 ce          	movzwl -0x32(%ebp),%edx
c010206a:	ee                   	out    %al,(%dx)
}
c010206b:	90                   	nop
c010206c:	66 c7 45 d2 20 00    	movw   $0x20,-0x2e(%ebp)
c0102072:	c6 45 d1 11          	movb   $0x11,-0x2f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0102076:	0f b6 45 d1          	movzbl -0x2f(%ebp),%eax
c010207a:	0f b7 55 d2          	movzwl -0x2e(%ebp),%edx
c010207e:	ee                   	out    %al,(%dx)
}
c010207f:	90                   	nop
c0102080:	66 c7 45 d6 21 00    	movw   $0x21,-0x2a(%ebp)
c0102086:	c6 45 d5 20          	movb   $0x20,-0x2b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010208a:	0f b6 45 d5          	movzbl -0x2b(%ebp),%eax
c010208e:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
c0102092:	ee                   	out    %al,(%dx)
}
c0102093:	90                   	nop
c0102094:	66 c7 45 da 21 00    	movw   $0x21,-0x26(%ebp)
c010209a:	c6 45 d9 04          	movb   $0x4,-0x27(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010209e:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
c01020a2:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
c01020a6:	ee                   	out    %al,(%dx)
}
c01020a7:	90                   	nop
c01020a8:	66 c7 45 de 21 00    	movw   $0x21,-0x22(%ebp)
c01020ae:	c6 45 dd 03          	movb   $0x3,-0x23(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01020b2:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
c01020b6:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
c01020ba:	ee                   	out    %al,(%dx)
}
c01020bb:	90                   	nop
c01020bc:	66 c7 45 e2 a0 00    	movw   $0xa0,-0x1e(%ebp)
c01020c2:	c6 45 e1 11          	movb   $0x11,-0x1f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01020c6:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
c01020ca:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
c01020ce:	ee                   	out    %al,(%dx)
}
c01020cf:	90                   	nop
c01020d0:	66 c7 45 e6 a1 00    	movw   $0xa1,-0x1a(%ebp)
c01020d6:	c6 45 e5 28          	movb   $0x28,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01020da:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c01020de:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c01020e2:	ee                   	out    %al,(%dx)
}
c01020e3:	90                   	nop
c01020e4:	66 c7 45 ea a1 00    	movw   $0xa1,-0x16(%ebp)
c01020ea:	c6 45 e9 02          	movb   $0x2,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01020ee:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c01020f2:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c01020f6:	ee                   	out    %al,(%dx)
}
c01020f7:	90                   	nop
c01020f8:	66 c7 45 ee a1 00    	movw   $0xa1,-0x12(%ebp)
c01020fe:	c6 45 ed 03          	movb   $0x3,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0102102:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0102106:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c010210a:	ee                   	out    %al,(%dx)
}
c010210b:	90                   	nop
c010210c:	66 c7 45 f2 20 00    	movw   $0x20,-0xe(%ebp)
c0102112:	c6 45 f1 68          	movb   $0x68,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0102116:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c010211a:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c010211e:	ee                   	out    %al,(%dx)
}
c010211f:	90                   	nop
c0102120:	66 c7 45 f6 20 00    	movw   $0x20,-0xa(%ebp)
c0102126:	c6 45 f5 0a          	movb   $0xa,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010212a:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c010212e:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c0102132:	ee                   	out    %al,(%dx)
}
c0102133:	90                   	nop
c0102134:	66 c7 45 fa a0 00    	movw   $0xa0,-0x6(%ebp)
c010213a:	c6 45 f9 68          	movb   $0x68,-0x7(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010213e:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c0102142:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
c0102146:	ee                   	out    %al,(%dx)
}
c0102147:	90                   	nop
c0102148:	66 c7 45 fe a0 00    	movw   $0xa0,-0x2(%ebp)
c010214e:	c6 45 fd 0a          	movb   $0xa,-0x3(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0102152:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
c0102156:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
c010215a:	ee                   	out    %al,(%dx)
}
c010215b:	90                   	nop
    outb(IO_PIC1, 0x0a);    // read IRR by default

    outb(IO_PIC2, 0x68);    // OCW3
    outb(IO_PIC2, 0x0a);    // OCW3

    if (irq_mask != 0xFFFF) {
c010215c:	0f b7 05 50 25 12 c0 	movzwl 0xc0122550,%eax
c0102163:	66 83 f8 ff          	cmp    $0xffff,%ax
c0102167:	74 13                	je     c010217c <pic_init+0x14c>
        pic_setmask(irq_mask);
c0102169:	0f b7 05 50 25 12 c0 	movzwl 0xc0122550,%eax
c0102170:	0f b7 c0             	movzwl %ax,%eax
c0102173:	50                   	push   %eax
c0102174:	e8 27 fe ff ff       	call   c0101fa0 <pic_setmask>
c0102179:	83 c4 04             	add    $0x4,%esp
    }
}
c010217c:	90                   	nop
c010217d:	c9                   	leave  
c010217e:	c3                   	ret    

c010217f <intr_enable>:
#include <x86.h>
#include <intr.h>

/* intr_enable - enable irq interrupt */
void
intr_enable(void) {
c010217f:	f3 0f 1e fb          	endbr32 
c0102183:	55                   	push   %ebp
c0102184:	89 e5                	mov    %esp,%ebp
    asm volatile ("sti");
c0102186:	fb                   	sti    
}
c0102187:	90                   	nop
    sti();
}
c0102188:	90                   	nop
c0102189:	5d                   	pop    %ebp
c010218a:	c3                   	ret    

c010218b <intr_disable>:

/* intr_disable - disable irq interrupt */
void
intr_disable(void) {
c010218b:	f3 0f 1e fb          	endbr32 
c010218f:	55                   	push   %ebp
c0102190:	89 e5                	mov    %esp,%ebp
    asm volatile ("cli" ::: "memory");
c0102192:	fa                   	cli    
}
c0102193:	90                   	nop
    cli();
}
c0102194:	90                   	nop
c0102195:	5d                   	pop    %ebp
c0102196:	c3                   	ret    

c0102197 <print_ticks>:
#include <swap.h>
#include <kdebug.h>

#define TICK_NUM 100

static void print_ticks() {
c0102197:	f3 0f 1e fb          	endbr32 
c010219b:	55                   	push   %ebp
c010219c:	89 e5                	mov    %esp,%ebp
c010219e:	83 ec 08             	sub    $0x8,%esp
    cprintf("%d ticks\n",TICK_NUM);
c01021a1:	83 ec 08             	sub    $0x8,%esp
c01021a4:	6a 64                	push   $0x64
c01021a6:	68 e0 88 10 c0       	push   $0xc01088e0
c01021ab:	e8 fa e0 ff ff       	call   c01002aa <cprintf>
c01021b0:	83 c4 10             	add    $0x10,%esp
#ifdef DEBUG_GRADE
    cprintf("End of Test.\n");
    panic("EOT: kernel seems ok.");
#endif
}
c01021b3:	90                   	nop
c01021b4:	c9                   	leave  
c01021b5:	c3                   	ret    

c01021b6 <idt_init>:
};

extern uintptr_t* __vectors[]; // 异常处理函数入口数组，大小为256
/* idt_init - initialize IDT to each of the entry points in kern/trap/vectors.S */
void
idt_init(void) {
c01021b6:	f3 0f 1e fb          	endbr32 
c01021ba:	55                   	push   %ebp
c01021bb:	89 e5                	mov    %esp,%ebp
c01021bd:	83 ec 10             	sub    $0x10,%esp
      * (3) After setup the contents of IDT, you will let CPU know where is the IDT by using 'lidt' instruction.
      *     You don't know the meaning of this instruction? just google it! and check the libs/x86.h to know more.
      *     Notice: the argument of lidt is idt_pd. try to find it!
      */
     
     for(int i = 0; i < 256; ++i){ 
c01021c0:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
c01021c7:	e9 c3 00 00 00       	jmp    c010228f <idt_init+0xd9>
        SETGATE(idt[i], 0, KERNEL_CS, __vectors[i], DPL_KERNEL);
c01021cc:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01021cf:	8b 04 85 e0 25 12 c0 	mov    -0x3fedda20(,%eax,4),%eax
c01021d6:	89 c2                	mov    %eax,%edx
c01021d8:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01021db:	66 89 14 c5 60 57 12 	mov    %dx,-0x3feda8a0(,%eax,8)
c01021e2:	c0 
c01021e3:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01021e6:	66 c7 04 c5 62 57 12 	movw   $0x8,-0x3feda89e(,%eax,8)
c01021ed:	c0 08 00 
c01021f0:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01021f3:	0f b6 14 c5 64 57 12 	movzbl -0x3feda89c(,%eax,8),%edx
c01021fa:	c0 
c01021fb:	83 e2 e0             	and    $0xffffffe0,%edx
c01021fe:	88 14 c5 64 57 12 c0 	mov    %dl,-0x3feda89c(,%eax,8)
c0102205:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0102208:	0f b6 14 c5 64 57 12 	movzbl -0x3feda89c(,%eax,8),%edx
c010220f:	c0 
c0102210:	83 e2 1f             	and    $0x1f,%edx
c0102213:	88 14 c5 64 57 12 c0 	mov    %dl,-0x3feda89c(,%eax,8)
c010221a:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010221d:	0f b6 14 c5 65 57 12 	movzbl -0x3feda89b(,%eax,8),%edx
c0102224:	c0 
c0102225:	83 e2 f0             	and    $0xfffffff0,%edx
c0102228:	83 ca 0e             	or     $0xe,%edx
c010222b:	88 14 c5 65 57 12 c0 	mov    %dl,-0x3feda89b(,%eax,8)
c0102232:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0102235:	0f b6 14 c5 65 57 12 	movzbl -0x3feda89b(,%eax,8),%edx
c010223c:	c0 
c010223d:	83 e2 ef             	and    $0xffffffef,%edx
c0102240:	88 14 c5 65 57 12 c0 	mov    %dl,-0x3feda89b(,%eax,8)
c0102247:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010224a:	0f b6 14 c5 65 57 12 	movzbl -0x3feda89b(,%eax,8),%edx
c0102251:	c0 
c0102252:	83 e2 9f             	and    $0xffffff9f,%edx
c0102255:	88 14 c5 65 57 12 c0 	mov    %dl,-0x3feda89b(,%eax,8)
c010225c:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010225f:	0f b6 14 c5 65 57 12 	movzbl -0x3feda89b(,%eax,8),%edx
c0102266:	c0 
c0102267:	83 ca 80             	or     $0xffffff80,%edx
c010226a:	88 14 c5 65 57 12 c0 	mov    %dl,-0x3feda89b(,%eax,8)
c0102271:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0102274:	8b 04 85 e0 25 12 c0 	mov    -0x3fedda20(,%eax,4),%eax
c010227b:	c1 e8 10             	shr    $0x10,%eax
c010227e:	89 c2                	mov    %eax,%edx
c0102280:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0102283:	66 89 14 c5 66 57 12 	mov    %dx,-0x3feda89a(,%eax,8)
c010228a:	c0 
     for(int i = 0; i < 256; ++i){ 
c010228b:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
c010228f:	81 7d fc ff 00 00 00 	cmpl   $0xff,-0x4(%ebp)
c0102296:	0f 8e 30 ff ff ff    	jle    c01021cc <idt_init+0x16>
c010229c:	c7 45 f8 60 25 12 c0 	movl   $0xc0122560,-0x8(%ebp)
    asm volatile ("lidt (%0)" :: "r" (pd) : "memory");
c01022a3:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01022a6:	0f 01 18             	lidtl  (%eax)
}
c01022a9:	90                   	nop
     }

     lidt(&idt_pd);
}
c01022aa:	90                   	nop
c01022ab:	c9                   	leave  
c01022ac:	c3                   	ret    

c01022ad <trapname>:

static const char *
trapname(int trapno) {
c01022ad:	f3 0f 1e fb          	endbr32 
c01022b1:	55                   	push   %ebp
c01022b2:	89 e5                	mov    %esp,%ebp
        "Alignment Check",
        "Machine-Check",
        "SIMD Floating-Point Exception"
    };

    if (trapno < sizeof(excnames)/sizeof(const char * const)) {
c01022b4:	8b 45 08             	mov    0x8(%ebp),%eax
c01022b7:	83 f8 13             	cmp    $0x13,%eax
c01022ba:	77 0c                	ja     c01022c8 <trapname+0x1b>
        return excnames[trapno];
c01022bc:	8b 45 08             	mov    0x8(%ebp),%eax
c01022bf:	8b 04 85 40 8d 10 c0 	mov    -0x3fef72c0(,%eax,4),%eax
c01022c6:	eb 18                	jmp    c01022e0 <trapname+0x33>
    }
    if (trapno >= IRQ_OFFSET && trapno < IRQ_OFFSET + 16) {
c01022c8:	83 7d 08 1f          	cmpl   $0x1f,0x8(%ebp)
c01022cc:	7e 0d                	jle    c01022db <trapname+0x2e>
c01022ce:	83 7d 08 2f          	cmpl   $0x2f,0x8(%ebp)
c01022d2:	7f 07                	jg     c01022db <trapname+0x2e>
        return "Hardware Interrupt";
c01022d4:	b8 ea 88 10 c0       	mov    $0xc01088ea,%eax
c01022d9:	eb 05                	jmp    c01022e0 <trapname+0x33>
    }
    return "(unknown trap)";
c01022db:	b8 fd 88 10 c0       	mov    $0xc01088fd,%eax
}
c01022e0:	5d                   	pop    %ebp
c01022e1:	c3                   	ret    

c01022e2 <trap_in_kernel>:

/* trap_in_kernel - test if trap happened in kernel */
bool
trap_in_kernel(struct trapframe *tf) {
c01022e2:	f3 0f 1e fb          	endbr32 
c01022e6:	55                   	push   %ebp
c01022e7:	89 e5                	mov    %esp,%ebp
    return (tf->tf_cs == (uint16_t)KERNEL_CS);
c01022e9:	8b 45 08             	mov    0x8(%ebp),%eax
c01022ec:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c01022f0:	66 83 f8 08          	cmp    $0x8,%ax
c01022f4:	0f 94 c0             	sete   %al
c01022f7:	0f b6 c0             	movzbl %al,%eax
}
c01022fa:	5d                   	pop    %ebp
c01022fb:	c3                   	ret    

c01022fc <print_trapframe>:
    "TF", "IF", "DF", "OF", NULL, NULL, "NT", NULL,
    "RF", "VM", "AC", "VIF", "VIP", "ID", NULL, NULL,
};

void
print_trapframe(struct trapframe *tf) {
c01022fc:	f3 0f 1e fb          	endbr32 
c0102300:	55                   	push   %ebp
c0102301:	89 e5                	mov    %esp,%ebp
c0102303:	83 ec 18             	sub    $0x18,%esp
    cprintf("trapframe at %p\n", tf);
c0102306:	83 ec 08             	sub    $0x8,%esp
c0102309:	ff 75 08             	pushl  0x8(%ebp)
c010230c:	68 3e 89 10 c0       	push   $0xc010893e
c0102311:	e8 94 df ff ff       	call   c01002aa <cprintf>
c0102316:	83 c4 10             	add    $0x10,%esp
    print_regs(&tf->tf_regs);
c0102319:	8b 45 08             	mov    0x8(%ebp),%eax
c010231c:	83 ec 0c             	sub    $0xc,%esp
c010231f:	50                   	push   %eax
c0102320:	e8 b4 01 00 00       	call   c01024d9 <print_regs>
c0102325:	83 c4 10             	add    $0x10,%esp
    cprintf("  ds   0x----%04x\n", tf->tf_ds);
c0102328:	8b 45 08             	mov    0x8(%ebp),%eax
c010232b:	0f b7 40 2c          	movzwl 0x2c(%eax),%eax
c010232f:	0f b7 c0             	movzwl %ax,%eax
c0102332:	83 ec 08             	sub    $0x8,%esp
c0102335:	50                   	push   %eax
c0102336:	68 4f 89 10 c0       	push   $0xc010894f
c010233b:	e8 6a df ff ff       	call   c01002aa <cprintf>
c0102340:	83 c4 10             	add    $0x10,%esp
    cprintf("  es   0x----%04x\n", tf->tf_es);
c0102343:	8b 45 08             	mov    0x8(%ebp),%eax
c0102346:	0f b7 40 28          	movzwl 0x28(%eax),%eax
c010234a:	0f b7 c0             	movzwl %ax,%eax
c010234d:	83 ec 08             	sub    $0x8,%esp
c0102350:	50                   	push   %eax
c0102351:	68 62 89 10 c0       	push   $0xc0108962
c0102356:	e8 4f df ff ff       	call   c01002aa <cprintf>
c010235b:	83 c4 10             	add    $0x10,%esp
    cprintf("  fs   0x----%04x\n", tf->tf_fs);
c010235e:	8b 45 08             	mov    0x8(%ebp),%eax
c0102361:	0f b7 40 24          	movzwl 0x24(%eax),%eax
c0102365:	0f b7 c0             	movzwl %ax,%eax
c0102368:	83 ec 08             	sub    $0x8,%esp
c010236b:	50                   	push   %eax
c010236c:	68 75 89 10 c0       	push   $0xc0108975
c0102371:	e8 34 df ff ff       	call   c01002aa <cprintf>
c0102376:	83 c4 10             	add    $0x10,%esp
    cprintf("  gs   0x----%04x\n", tf->tf_gs);
c0102379:	8b 45 08             	mov    0x8(%ebp),%eax
c010237c:	0f b7 40 20          	movzwl 0x20(%eax),%eax
c0102380:	0f b7 c0             	movzwl %ax,%eax
c0102383:	83 ec 08             	sub    $0x8,%esp
c0102386:	50                   	push   %eax
c0102387:	68 88 89 10 c0       	push   $0xc0108988
c010238c:	e8 19 df ff ff       	call   c01002aa <cprintf>
c0102391:	83 c4 10             	add    $0x10,%esp
    cprintf("  trap 0x%08x %s\n", tf->tf_trapno, trapname(tf->tf_trapno));
c0102394:	8b 45 08             	mov    0x8(%ebp),%eax
c0102397:	8b 40 30             	mov    0x30(%eax),%eax
c010239a:	83 ec 0c             	sub    $0xc,%esp
c010239d:	50                   	push   %eax
c010239e:	e8 0a ff ff ff       	call   c01022ad <trapname>
c01023a3:	83 c4 10             	add    $0x10,%esp
c01023a6:	8b 55 08             	mov    0x8(%ebp),%edx
c01023a9:	8b 52 30             	mov    0x30(%edx),%edx
c01023ac:	83 ec 04             	sub    $0x4,%esp
c01023af:	50                   	push   %eax
c01023b0:	52                   	push   %edx
c01023b1:	68 9b 89 10 c0       	push   $0xc010899b
c01023b6:	e8 ef de ff ff       	call   c01002aa <cprintf>
c01023bb:	83 c4 10             	add    $0x10,%esp
    cprintf("  err  0x%08x\n", tf->tf_err);
c01023be:	8b 45 08             	mov    0x8(%ebp),%eax
c01023c1:	8b 40 34             	mov    0x34(%eax),%eax
c01023c4:	83 ec 08             	sub    $0x8,%esp
c01023c7:	50                   	push   %eax
c01023c8:	68 ad 89 10 c0       	push   $0xc01089ad
c01023cd:	e8 d8 de ff ff       	call   c01002aa <cprintf>
c01023d2:	83 c4 10             	add    $0x10,%esp
    cprintf("  eip  0x%08x\n", tf->tf_eip);
c01023d5:	8b 45 08             	mov    0x8(%ebp),%eax
c01023d8:	8b 40 38             	mov    0x38(%eax),%eax
c01023db:	83 ec 08             	sub    $0x8,%esp
c01023de:	50                   	push   %eax
c01023df:	68 bc 89 10 c0       	push   $0xc01089bc
c01023e4:	e8 c1 de ff ff       	call   c01002aa <cprintf>
c01023e9:	83 c4 10             	add    $0x10,%esp
    cprintf("  cs   0x----%04x\n", tf->tf_cs);
c01023ec:	8b 45 08             	mov    0x8(%ebp),%eax
c01023ef:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c01023f3:	0f b7 c0             	movzwl %ax,%eax
c01023f6:	83 ec 08             	sub    $0x8,%esp
c01023f9:	50                   	push   %eax
c01023fa:	68 cb 89 10 c0       	push   $0xc01089cb
c01023ff:	e8 a6 de ff ff       	call   c01002aa <cprintf>
c0102404:	83 c4 10             	add    $0x10,%esp
    cprintf("  flag 0x%08x ", tf->tf_eflags);
c0102407:	8b 45 08             	mov    0x8(%ebp),%eax
c010240a:	8b 40 40             	mov    0x40(%eax),%eax
c010240d:	83 ec 08             	sub    $0x8,%esp
c0102410:	50                   	push   %eax
c0102411:	68 de 89 10 c0       	push   $0xc01089de
c0102416:	e8 8f de ff ff       	call   c01002aa <cprintf>
c010241b:	83 c4 10             	add    $0x10,%esp

    int i, j;
    for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
c010241e:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0102425:	c7 45 f0 01 00 00 00 	movl   $0x1,-0x10(%ebp)
c010242c:	eb 3f                	jmp    c010246d <print_trapframe+0x171>
        if ((tf->tf_eflags & j) && IA32flags[i] != NULL) {
c010242e:	8b 45 08             	mov    0x8(%ebp),%eax
c0102431:	8b 50 40             	mov    0x40(%eax),%edx
c0102434:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0102437:	21 d0                	and    %edx,%eax
c0102439:	85 c0                	test   %eax,%eax
c010243b:	74 29                	je     c0102466 <print_trapframe+0x16a>
c010243d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102440:	8b 04 85 80 25 12 c0 	mov    -0x3fedda80(,%eax,4),%eax
c0102447:	85 c0                	test   %eax,%eax
c0102449:	74 1b                	je     c0102466 <print_trapframe+0x16a>
            cprintf("%s,", IA32flags[i]);
c010244b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010244e:	8b 04 85 80 25 12 c0 	mov    -0x3fedda80(,%eax,4),%eax
c0102455:	83 ec 08             	sub    $0x8,%esp
c0102458:	50                   	push   %eax
c0102459:	68 ed 89 10 c0       	push   $0xc01089ed
c010245e:	e8 47 de ff ff       	call   c01002aa <cprintf>
c0102463:	83 c4 10             	add    $0x10,%esp
    for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
c0102466:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c010246a:	d1 65 f0             	shll   -0x10(%ebp)
c010246d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102470:	83 f8 17             	cmp    $0x17,%eax
c0102473:	76 b9                	jbe    c010242e <print_trapframe+0x132>
        }
    }
    cprintf("IOPL=%d\n", (tf->tf_eflags & FL_IOPL_MASK) >> 12);
c0102475:	8b 45 08             	mov    0x8(%ebp),%eax
c0102478:	8b 40 40             	mov    0x40(%eax),%eax
c010247b:	c1 e8 0c             	shr    $0xc,%eax
c010247e:	83 e0 03             	and    $0x3,%eax
c0102481:	83 ec 08             	sub    $0x8,%esp
c0102484:	50                   	push   %eax
c0102485:	68 f1 89 10 c0       	push   $0xc01089f1
c010248a:	e8 1b de ff ff       	call   c01002aa <cprintf>
c010248f:	83 c4 10             	add    $0x10,%esp

    if (!trap_in_kernel(tf)) {
c0102492:	83 ec 0c             	sub    $0xc,%esp
c0102495:	ff 75 08             	pushl  0x8(%ebp)
c0102498:	e8 45 fe ff ff       	call   c01022e2 <trap_in_kernel>
c010249d:	83 c4 10             	add    $0x10,%esp
c01024a0:	85 c0                	test   %eax,%eax
c01024a2:	75 32                	jne    c01024d6 <print_trapframe+0x1da>
        cprintf("  esp  0x%08x\n", tf->tf_esp);
c01024a4:	8b 45 08             	mov    0x8(%ebp),%eax
c01024a7:	8b 40 44             	mov    0x44(%eax),%eax
c01024aa:	83 ec 08             	sub    $0x8,%esp
c01024ad:	50                   	push   %eax
c01024ae:	68 fa 89 10 c0       	push   $0xc01089fa
c01024b3:	e8 f2 dd ff ff       	call   c01002aa <cprintf>
c01024b8:	83 c4 10             	add    $0x10,%esp
        cprintf("  ss   0x----%04x\n", tf->tf_ss);
c01024bb:	8b 45 08             	mov    0x8(%ebp),%eax
c01024be:	0f b7 40 48          	movzwl 0x48(%eax),%eax
c01024c2:	0f b7 c0             	movzwl %ax,%eax
c01024c5:	83 ec 08             	sub    $0x8,%esp
c01024c8:	50                   	push   %eax
c01024c9:	68 09 8a 10 c0       	push   $0xc0108a09
c01024ce:	e8 d7 dd ff ff       	call   c01002aa <cprintf>
c01024d3:	83 c4 10             	add    $0x10,%esp
    }
}
c01024d6:	90                   	nop
c01024d7:	c9                   	leave  
c01024d8:	c3                   	ret    

c01024d9 <print_regs>:

void
print_regs(struct pushregs *regs) {
c01024d9:	f3 0f 1e fb          	endbr32 
c01024dd:	55                   	push   %ebp
c01024de:	89 e5                	mov    %esp,%ebp
c01024e0:	83 ec 08             	sub    $0x8,%esp
    cprintf("  edi  0x%08x\n", regs->reg_edi);
c01024e3:	8b 45 08             	mov    0x8(%ebp),%eax
c01024e6:	8b 00                	mov    (%eax),%eax
c01024e8:	83 ec 08             	sub    $0x8,%esp
c01024eb:	50                   	push   %eax
c01024ec:	68 1c 8a 10 c0       	push   $0xc0108a1c
c01024f1:	e8 b4 dd ff ff       	call   c01002aa <cprintf>
c01024f6:	83 c4 10             	add    $0x10,%esp
    cprintf("  esi  0x%08x\n", regs->reg_esi);
c01024f9:	8b 45 08             	mov    0x8(%ebp),%eax
c01024fc:	8b 40 04             	mov    0x4(%eax),%eax
c01024ff:	83 ec 08             	sub    $0x8,%esp
c0102502:	50                   	push   %eax
c0102503:	68 2b 8a 10 c0       	push   $0xc0108a2b
c0102508:	e8 9d dd ff ff       	call   c01002aa <cprintf>
c010250d:	83 c4 10             	add    $0x10,%esp
    cprintf("  ebp  0x%08x\n", regs->reg_ebp);
c0102510:	8b 45 08             	mov    0x8(%ebp),%eax
c0102513:	8b 40 08             	mov    0x8(%eax),%eax
c0102516:	83 ec 08             	sub    $0x8,%esp
c0102519:	50                   	push   %eax
c010251a:	68 3a 8a 10 c0       	push   $0xc0108a3a
c010251f:	e8 86 dd ff ff       	call   c01002aa <cprintf>
c0102524:	83 c4 10             	add    $0x10,%esp
    cprintf("  oesp 0x%08x\n", regs->reg_oesp);
c0102527:	8b 45 08             	mov    0x8(%ebp),%eax
c010252a:	8b 40 0c             	mov    0xc(%eax),%eax
c010252d:	83 ec 08             	sub    $0x8,%esp
c0102530:	50                   	push   %eax
c0102531:	68 49 8a 10 c0       	push   $0xc0108a49
c0102536:	e8 6f dd ff ff       	call   c01002aa <cprintf>
c010253b:	83 c4 10             	add    $0x10,%esp
    cprintf("  ebx  0x%08x\n", regs->reg_ebx);
c010253e:	8b 45 08             	mov    0x8(%ebp),%eax
c0102541:	8b 40 10             	mov    0x10(%eax),%eax
c0102544:	83 ec 08             	sub    $0x8,%esp
c0102547:	50                   	push   %eax
c0102548:	68 58 8a 10 c0       	push   $0xc0108a58
c010254d:	e8 58 dd ff ff       	call   c01002aa <cprintf>
c0102552:	83 c4 10             	add    $0x10,%esp
    cprintf("  edx  0x%08x\n", regs->reg_edx);
c0102555:	8b 45 08             	mov    0x8(%ebp),%eax
c0102558:	8b 40 14             	mov    0x14(%eax),%eax
c010255b:	83 ec 08             	sub    $0x8,%esp
c010255e:	50                   	push   %eax
c010255f:	68 67 8a 10 c0       	push   $0xc0108a67
c0102564:	e8 41 dd ff ff       	call   c01002aa <cprintf>
c0102569:	83 c4 10             	add    $0x10,%esp
    cprintf("  ecx  0x%08x\n", regs->reg_ecx);
c010256c:	8b 45 08             	mov    0x8(%ebp),%eax
c010256f:	8b 40 18             	mov    0x18(%eax),%eax
c0102572:	83 ec 08             	sub    $0x8,%esp
c0102575:	50                   	push   %eax
c0102576:	68 76 8a 10 c0       	push   $0xc0108a76
c010257b:	e8 2a dd ff ff       	call   c01002aa <cprintf>
c0102580:	83 c4 10             	add    $0x10,%esp
    cprintf("  eax  0x%08x\n", regs->reg_eax);
c0102583:	8b 45 08             	mov    0x8(%ebp),%eax
c0102586:	8b 40 1c             	mov    0x1c(%eax),%eax
c0102589:	83 ec 08             	sub    $0x8,%esp
c010258c:	50                   	push   %eax
c010258d:	68 85 8a 10 c0       	push   $0xc0108a85
c0102592:	e8 13 dd ff ff       	call   c01002aa <cprintf>
c0102597:	83 c4 10             	add    $0x10,%esp
}
c010259a:	90                   	nop
c010259b:	c9                   	leave  
c010259c:	c3                   	ret    

c010259d <print_pgfault>:

static inline void
print_pgfault(struct trapframe *tf) {
c010259d:	55                   	push   %ebp
c010259e:	89 e5                	mov    %esp,%ebp
c01025a0:	53                   	push   %ebx
c01025a1:	83 ec 14             	sub    $0x14,%esp
     * bit 2 == 0 means kernel, 1 means user
     * */
    cprintf("page fault at 0x%08x: %c/%c [%s].\n", rcr2(),
            (tf->tf_err & 4) ? 'U' : 'K',
            (tf->tf_err & 2) ? 'W' : 'R',
            (tf->tf_err & 1) ? "protection fault" : "no page found");
c01025a4:	8b 45 08             	mov    0x8(%ebp),%eax
c01025a7:	8b 40 34             	mov    0x34(%eax),%eax
c01025aa:	83 e0 01             	and    $0x1,%eax
    cprintf("page fault at 0x%08x: %c/%c [%s].\n", rcr2(),
c01025ad:	85 c0                	test   %eax,%eax
c01025af:	74 07                	je     c01025b8 <print_pgfault+0x1b>
c01025b1:	bb 94 8a 10 c0       	mov    $0xc0108a94,%ebx
c01025b6:	eb 05                	jmp    c01025bd <print_pgfault+0x20>
c01025b8:	bb a5 8a 10 c0       	mov    $0xc0108aa5,%ebx
            (tf->tf_err & 2) ? 'W' : 'R',
c01025bd:	8b 45 08             	mov    0x8(%ebp),%eax
c01025c0:	8b 40 34             	mov    0x34(%eax),%eax
c01025c3:	83 e0 02             	and    $0x2,%eax
    cprintf("page fault at 0x%08x: %c/%c [%s].\n", rcr2(),
c01025c6:	85 c0                	test   %eax,%eax
c01025c8:	74 07                	je     c01025d1 <print_pgfault+0x34>
c01025ca:	b9 57 00 00 00       	mov    $0x57,%ecx
c01025cf:	eb 05                	jmp    c01025d6 <print_pgfault+0x39>
c01025d1:	b9 52 00 00 00       	mov    $0x52,%ecx
            (tf->tf_err & 4) ? 'U' : 'K',
c01025d6:	8b 45 08             	mov    0x8(%ebp),%eax
c01025d9:	8b 40 34             	mov    0x34(%eax),%eax
c01025dc:	83 e0 04             	and    $0x4,%eax
    cprintf("page fault at 0x%08x: %c/%c [%s].\n", rcr2(),
c01025df:	85 c0                	test   %eax,%eax
c01025e1:	74 07                	je     c01025ea <print_pgfault+0x4d>
c01025e3:	ba 55 00 00 00       	mov    $0x55,%edx
c01025e8:	eb 05                	jmp    c01025ef <print_pgfault+0x52>
c01025ea:	ba 4b 00 00 00       	mov    $0x4b,%edx
}

static inline uintptr_t
rcr2(void) {
    uintptr_t cr2;
    asm volatile ("mov %%cr2, %0" : "=r" (cr2) :: "memory");
c01025ef:	0f 20 d0             	mov    %cr2,%eax
c01025f2:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return cr2;
c01025f5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01025f8:	83 ec 0c             	sub    $0xc,%esp
c01025fb:	53                   	push   %ebx
c01025fc:	51                   	push   %ecx
c01025fd:	52                   	push   %edx
c01025fe:	50                   	push   %eax
c01025ff:	68 b4 8a 10 c0       	push   $0xc0108ab4
c0102604:	e8 a1 dc ff ff       	call   c01002aa <cprintf>
c0102609:	83 c4 20             	add    $0x20,%esp
}
c010260c:	90                   	nop
c010260d:	8b 5d fc             	mov    -0x4(%ebp),%ebx
c0102610:	c9                   	leave  
c0102611:	c3                   	ret    

c0102612 <pgfault_handler>:

static int
pgfault_handler(struct trapframe *tf) {
c0102612:	f3 0f 1e fb          	endbr32 
c0102616:	55                   	push   %ebp
c0102617:	89 e5                	mov    %esp,%ebp
c0102619:	83 ec 18             	sub    $0x18,%esp
    extern struct mm_struct *check_mm_struct;
    print_pgfault(tf);
c010261c:	83 ec 0c             	sub    $0xc,%esp
c010261f:	ff 75 08             	pushl  0x8(%ebp)
c0102622:	e8 76 ff ff ff       	call   c010259d <print_pgfault>
c0102627:	83 c4 10             	add    $0x10,%esp
    if (check_mm_struct != NULL) {
c010262a:	a1 10 60 12 c0       	mov    0xc0126010,%eax
c010262f:	85 c0                	test   %eax,%eax
c0102631:	74 24                	je     c0102657 <pgfault_handler+0x45>
    asm volatile ("mov %%cr2, %0" : "=r" (cr2) :: "memory");
c0102633:	0f 20 d0             	mov    %cr2,%eax
c0102636:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return cr2;
c0102639:	8b 4d f4             	mov    -0xc(%ebp),%ecx
        return do_pgfault(check_mm_struct, tf->tf_err, rcr2());
c010263c:	8b 45 08             	mov    0x8(%ebp),%eax
c010263f:	8b 50 34             	mov    0x34(%eax),%edx
c0102642:	a1 10 60 12 c0       	mov    0xc0126010,%eax
c0102647:	83 ec 04             	sub    $0x4,%esp
c010264a:	51                   	push   %ecx
c010264b:	52                   	push   %edx
c010264c:	50                   	push   %eax
c010264d:	e8 70 16 00 00       	call   c0103cc2 <do_pgfault>
c0102652:	83 c4 10             	add    $0x10,%esp
c0102655:	eb 17                	jmp    c010266e <pgfault_handler+0x5c>
    }
    panic("unhandled page fault.\n");
c0102657:	83 ec 04             	sub    $0x4,%esp
c010265a:	68 d7 8a 10 c0       	push   $0xc0108ad7
c010265f:	68 a6 00 00 00       	push   $0xa6
c0102664:	68 ee 8a 10 c0       	push   $0xc0108aee
c0102669:	e8 b7 dd ff ff       	call   c0100425 <__panic>
}
c010266e:	c9                   	leave  
c010266f:	c3                   	ret    

c0102670 <trap_dispatch>:

static volatile int in_swap_tick_event = 0;
extern struct mm_struct *check_mm_struct;

static void
trap_dispatch(struct trapframe *tf) {
c0102670:	f3 0f 1e fb          	endbr32 
c0102674:	55                   	push   %ebp
c0102675:	89 e5                	mov    %esp,%ebp
c0102677:	83 ec 18             	sub    $0x18,%esp
    char c;

    int ret;

    switch (tf->tf_trapno) {
c010267a:	8b 45 08             	mov    0x8(%ebp),%eax
c010267d:	8b 40 30             	mov    0x30(%eax),%eax
c0102680:	83 f8 2f             	cmp    $0x2f,%eax
c0102683:	77 1f                	ja     c01026a4 <trap_dispatch+0x34>
c0102685:	83 f8 0e             	cmp    $0xe,%eax
c0102688:	0f 82 c6 00 00 00    	jb     c0102754 <trap_dispatch+0xe4>
c010268e:	83 e8 0e             	sub    $0xe,%eax
c0102691:	83 f8 21             	cmp    $0x21,%eax
c0102694:	0f 87 ba 00 00 00    	ja     c0102754 <trap_dispatch+0xe4>
c010269a:	8b 04 85 68 8b 10 c0 	mov    -0x3fef7498(,%eax,4),%eax
c01026a1:	3e ff e0             	notrack jmp *%eax
c01026a4:	83 e8 78             	sub    $0x78,%eax
c01026a7:	83 f8 01             	cmp    $0x1,%eax
c01026aa:	0f 87 a4 00 00 00    	ja     c0102754 <trap_dispatch+0xe4>
c01026b0:	e9 88 00 00 00       	jmp    c010273d <trap_dispatch+0xcd>
    case T_PGFLT:  //page fault
        if ((ret = pgfault_handler(tf)) != 0) {
c01026b5:	83 ec 0c             	sub    $0xc,%esp
c01026b8:	ff 75 08             	pushl  0x8(%ebp)
c01026bb:	e8 52 ff ff ff       	call   c0102612 <pgfault_handler>
c01026c0:	83 c4 10             	add    $0x10,%esp
c01026c3:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01026c6:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c01026ca:	0f 84 bd 00 00 00    	je     c010278d <trap_dispatch+0x11d>
            print_trapframe(tf);
c01026d0:	83 ec 0c             	sub    $0xc,%esp
c01026d3:	ff 75 08             	pushl  0x8(%ebp)
c01026d6:	e8 21 fc ff ff       	call   c01022fc <print_trapframe>
c01026db:	83 c4 10             	add    $0x10,%esp
            panic("handle pgfault failed. %e\n", ret);
c01026de:	ff 75 f0             	pushl  -0x10(%ebp)
c01026e1:	68 ff 8a 10 c0       	push   $0xc0108aff
c01026e6:	68 b6 00 00 00       	push   $0xb6
c01026eb:	68 ee 8a 10 c0       	push   $0xc0108aee
c01026f0:	e8 30 dd ff ff       	call   c0100425 <__panic>
         * (2) Every TICK_NUM cycle, you can print some info using a funciton, such as print_ticks().
         * (3) Too Simple? Yes, I think so!
         */
      
    case IRQ_OFFSET + IRQ_COM1:
        c = cons_getc();
c01026f5:	e8 30 f8 ff ff       	call   c0101f2a <cons_getc>
c01026fa:	88 45 f7             	mov    %al,-0x9(%ebp)
        cprintf("serial [%03d] %c\n", c, c);
c01026fd:	0f be 55 f7          	movsbl -0x9(%ebp),%edx
c0102701:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
c0102705:	83 ec 04             	sub    $0x4,%esp
c0102708:	52                   	push   %edx
c0102709:	50                   	push   %eax
c010270a:	68 1a 8b 10 c0       	push   $0xc0108b1a
c010270f:	e8 96 db ff ff       	call   c01002aa <cprintf>
c0102714:	83 c4 10             	add    $0x10,%esp
        break;
c0102717:	eb 75                	jmp    c010278e <trap_dispatch+0x11e>
    case IRQ_OFFSET + IRQ_KBD:
        c = cons_getc();
c0102719:	e8 0c f8 ff ff       	call   c0101f2a <cons_getc>
c010271e:	88 45 f7             	mov    %al,-0x9(%ebp)
        cprintf("kbd [%03d] %c\n", c, c);
c0102721:	0f be 55 f7          	movsbl -0x9(%ebp),%edx
c0102725:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
c0102729:	83 ec 04             	sub    $0x4,%esp
c010272c:	52                   	push   %edx
c010272d:	50                   	push   %eax
c010272e:	68 2c 8b 10 c0       	push   $0xc0108b2c
c0102733:	e8 72 db ff ff       	call   c01002aa <cprintf>
c0102738:	83 c4 10             	add    $0x10,%esp
        break;
c010273b:	eb 51                	jmp    c010278e <trap_dispatch+0x11e>
    //LAB1 CHALLENGE 1 : YOUR CODE you should modify below codes.
    case T_SWITCH_TOU:
    case T_SWITCH_TOK:
        panic("T_SWITCH_** ??\n");
c010273d:	83 ec 04             	sub    $0x4,%esp
c0102740:	68 3b 8b 10 c0       	push   $0xc0108b3b
c0102745:	68 cc 00 00 00       	push   $0xcc
c010274a:	68 ee 8a 10 c0       	push   $0xc0108aee
c010274f:	e8 d1 dc ff ff       	call   c0100425 <__panic>
    case IRQ_OFFSET + IRQ_IDE2:
        /* do nothing */
        break;
    default:
        // in kernel, it must be a mistake
        if ((tf->tf_cs & 3) == 0) {
c0102754:	8b 45 08             	mov    0x8(%ebp),%eax
c0102757:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c010275b:	0f b7 c0             	movzwl %ax,%eax
c010275e:	83 e0 03             	and    $0x3,%eax
c0102761:	85 c0                	test   %eax,%eax
c0102763:	75 29                	jne    c010278e <trap_dispatch+0x11e>
            print_trapframe(tf);
c0102765:	83 ec 0c             	sub    $0xc,%esp
c0102768:	ff 75 08             	pushl  0x8(%ebp)
c010276b:	e8 8c fb ff ff       	call   c01022fc <print_trapframe>
c0102770:	83 c4 10             	add    $0x10,%esp
            panic("unexpected trap in kernel.\n");
c0102773:	83 ec 04             	sub    $0x4,%esp
c0102776:	68 4b 8b 10 c0       	push   $0xc0108b4b
c010277b:	68 d6 00 00 00       	push   $0xd6
c0102780:	68 ee 8a 10 c0       	push   $0xc0108aee
c0102785:	e8 9b dc ff ff       	call   c0100425 <__panic>
        break;
c010278a:	90                   	nop
c010278b:	eb 01                	jmp    c010278e <trap_dispatch+0x11e>
        break;
c010278d:	90                   	nop
        }
    }
}
c010278e:	90                   	nop
c010278f:	c9                   	leave  
c0102790:	c3                   	ret    

c0102791 <trap>:
 * trap - handles or dispatches an exception/interrupt. if and when trap() returns,
 * the code in kern/trap/trapentry.S restores the old CPU state saved in the
 * trapframe and then uses the iret instruction to return from the exception.
 * */
void
trap(struct trapframe *tf) {
c0102791:	f3 0f 1e fb          	endbr32 
c0102795:	55                   	push   %ebp
c0102796:	89 e5                	mov    %esp,%ebp
c0102798:	83 ec 08             	sub    $0x8,%esp
    // dispatch based on what type of trap occurred
    trap_dispatch(tf);
c010279b:	83 ec 0c             	sub    $0xc,%esp
c010279e:	ff 75 08             	pushl  0x8(%ebp)
c01027a1:	e8 ca fe ff ff       	call   c0102670 <trap_dispatch>
c01027a6:	83 c4 10             	add    $0x10,%esp
}
c01027a9:	90                   	nop
c01027aa:	c9                   	leave  
c01027ab:	c3                   	ret    

c01027ac <vector0>:
# handler
.text
.globl __alltraps
.globl vector0
vector0:
  pushl $0
c01027ac:	6a 00                	push   $0x0
  pushl $0
c01027ae:	6a 00                	push   $0x0
  jmp __alltraps
c01027b0:	e9 67 0a 00 00       	jmp    c010321c <__alltraps>

c01027b5 <vector1>:
.globl vector1
vector1:
  pushl $0
c01027b5:	6a 00                	push   $0x0
  pushl $1
c01027b7:	6a 01                	push   $0x1
  jmp __alltraps
c01027b9:	e9 5e 0a 00 00       	jmp    c010321c <__alltraps>

c01027be <vector2>:
.globl vector2
vector2:
  pushl $0
c01027be:	6a 00                	push   $0x0
  pushl $2
c01027c0:	6a 02                	push   $0x2
  jmp __alltraps
c01027c2:	e9 55 0a 00 00       	jmp    c010321c <__alltraps>

c01027c7 <vector3>:
.globl vector3
vector3:
  pushl $0
c01027c7:	6a 00                	push   $0x0
  pushl $3
c01027c9:	6a 03                	push   $0x3
  jmp __alltraps
c01027cb:	e9 4c 0a 00 00       	jmp    c010321c <__alltraps>

c01027d0 <vector4>:
.globl vector4
vector4:
  pushl $0
c01027d0:	6a 00                	push   $0x0
  pushl $4
c01027d2:	6a 04                	push   $0x4
  jmp __alltraps
c01027d4:	e9 43 0a 00 00       	jmp    c010321c <__alltraps>

c01027d9 <vector5>:
.globl vector5
vector5:
  pushl $0
c01027d9:	6a 00                	push   $0x0
  pushl $5
c01027db:	6a 05                	push   $0x5
  jmp __alltraps
c01027dd:	e9 3a 0a 00 00       	jmp    c010321c <__alltraps>

c01027e2 <vector6>:
.globl vector6
vector6:
  pushl $0
c01027e2:	6a 00                	push   $0x0
  pushl $6
c01027e4:	6a 06                	push   $0x6
  jmp __alltraps
c01027e6:	e9 31 0a 00 00       	jmp    c010321c <__alltraps>

c01027eb <vector7>:
.globl vector7
vector7:
  pushl $0
c01027eb:	6a 00                	push   $0x0
  pushl $7
c01027ed:	6a 07                	push   $0x7
  jmp __alltraps
c01027ef:	e9 28 0a 00 00       	jmp    c010321c <__alltraps>

c01027f4 <vector8>:
.globl vector8
vector8:
  pushl $8
c01027f4:	6a 08                	push   $0x8
  jmp __alltraps
c01027f6:	e9 21 0a 00 00       	jmp    c010321c <__alltraps>

c01027fb <vector9>:
.globl vector9
vector9:
  pushl $9
c01027fb:	6a 09                	push   $0x9
  jmp __alltraps
c01027fd:	e9 1a 0a 00 00       	jmp    c010321c <__alltraps>

c0102802 <vector10>:
.globl vector10
vector10:
  pushl $10
c0102802:	6a 0a                	push   $0xa
  jmp __alltraps
c0102804:	e9 13 0a 00 00       	jmp    c010321c <__alltraps>

c0102809 <vector11>:
.globl vector11
vector11:
  pushl $11
c0102809:	6a 0b                	push   $0xb
  jmp __alltraps
c010280b:	e9 0c 0a 00 00       	jmp    c010321c <__alltraps>

c0102810 <vector12>:
.globl vector12
vector12:
  pushl $12
c0102810:	6a 0c                	push   $0xc
  jmp __alltraps
c0102812:	e9 05 0a 00 00       	jmp    c010321c <__alltraps>

c0102817 <vector13>:
.globl vector13
vector13:
  pushl $13
c0102817:	6a 0d                	push   $0xd
  jmp __alltraps
c0102819:	e9 fe 09 00 00       	jmp    c010321c <__alltraps>

c010281e <vector14>:
.globl vector14
vector14:
  pushl $14
c010281e:	6a 0e                	push   $0xe
  jmp __alltraps
c0102820:	e9 f7 09 00 00       	jmp    c010321c <__alltraps>

c0102825 <vector15>:
.globl vector15
vector15:
  pushl $0
c0102825:	6a 00                	push   $0x0
  pushl $15
c0102827:	6a 0f                	push   $0xf
  jmp __alltraps
c0102829:	e9 ee 09 00 00       	jmp    c010321c <__alltraps>

c010282e <vector16>:
.globl vector16
vector16:
  pushl $0
c010282e:	6a 00                	push   $0x0
  pushl $16
c0102830:	6a 10                	push   $0x10
  jmp __alltraps
c0102832:	e9 e5 09 00 00       	jmp    c010321c <__alltraps>

c0102837 <vector17>:
.globl vector17
vector17:
  pushl $17
c0102837:	6a 11                	push   $0x11
  jmp __alltraps
c0102839:	e9 de 09 00 00       	jmp    c010321c <__alltraps>

c010283e <vector18>:
.globl vector18
vector18:
  pushl $0
c010283e:	6a 00                	push   $0x0
  pushl $18
c0102840:	6a 12                	push   $0x12
  jmp __alltraps
c0102842:	e9 d5 09 00 00       	jmp    c010321c <__alltraps>

c0102847 <vector19>:
.globl vector19
vector19:
  pushl $0
c0102847:	6a 00                	push   $0x0
  pushl $19
c0102849:	6a 13                	push   $0x13
  jmp __alltraps
c010284b:	e9 cc 09 00 00       	jmp    c010321c <__alltraps>

c0102850 <vector20>:
.globl vector20
vector20:
  pushl $0
c0102850:	6a 00                	push   $0x0
  pushl $20
c0102852:	6a 14                	push   $0x14
  jmp __alltraps
c0102854:	e9 c3 09 00 00       	jmp    c010321c <__alltraps>

c0102859 <vector21>:
.globl vector21
vector21:
  pushl $0
c0102859:	6a 00                	push   $0x0
  pushl $21
c010285b:	6a 15                	push   $0x15
  jmp __alltraps
c010285d:	e9 ba 09 00 00       	jmp    c010321c <__alltraps>

c0102862 <vector22>:
.globl vector22
vector22:
  pushl $0
c0102862:	6a 00                	push   $0x0
  pushl $22
c0102864:	6a 16                	push   $0x16
  jmp __alltraps
c0102866:	e9 b1 09 00 00       	jmp    c010321c <__alltraps>

c010286b <vector23>:
.globl vector23
vector23:
  pushl $0
c010286b:	6a 00                	push   $0x0
  pushl $23
c010286d:	6a 17                	push   $0x17
  jmp __alltraps
c010286f:	e9 a8 09 00 00       	jmp    c010321c <__alltraps>

c0102874 <vector24>:
.globl vector24
vector24:
  pushl $0
c0102874:	6a 00                	push   $0x0
  pushl $24
c0102876:	6a 18                	push   $0x18
  jmp __alltraps
c0102878:	e9 9f 09 00 00       	jmp    c010321c <__alltraps>

c010287d <vector25>:
.globl vector25
vector25:
  pushl $0
c010287d:	6a 00                	push   $0x0
  pushl $25
c010287f:	6a 19                	push   $0x19
  jmp __alltraps
c0102881:	e9 96 09 00 00       	jmp    c010321c <__alltraps>

c0102886 <vector26>:
.globl vector26
vector26:
  pushl $0
c0102886:	6a 00                	push   $0x0
  pushl $26
c0102888:	6a 1a                	push   $0x1a
  jmp __alltraps
c010288a:	e9 8d 09 00 00       	jmp    c010321c <__alltraps>

c010288f <vector27>:
.globl vector27
vector27:
  pushl $0
c010288f:	6a 00                	push   $0x0
  pushl $27
c0102891:	6a 1b                	push   $0x1b
  jmp __alltraps
c0102893:	e9 84 09 00 00       	jmp    c010321c <__alltraps>

c0102898 <vector28>:
.globl vector28
vector28:
  pushl $0
c0102898:	6a 00                	push   $0x0
  pushl $28
c010289a:	6a 1c                	push   $0x1c
  jmp __alltraps
c010289c:	e9 7b 09 00 00       	jmp    c010321c <__alltraps>

c01028a1 <vector29>:
.globl vector29
vector29:
  pushl $0
c01028a1:	6a 00                	push   $0x0
  pushl $29
c01028a3:	6a 1d                	push   $0x1d
  jmp __alltraps
c01028a5:	e9 72 09 00 00       	jmp    c010321c <__alltraps>

c01028aa <vector30>:
.globl vector30
vector30:
  pushl $0
c01028aa:	6a 00                	push   $0x0
  pushl $30
c01028ac:	6a 1e                	push   $0x1e
  jmp __alltraps
c01028ae:	e9 69 09 00 00       	jmp    c010321c <__alltraps>

c01028b3 <vector31>:
.globl vector31
vector31:
  pushl $0
c01028b3:	6a 00                	push   $0x0
  pushl $31
c01028b5:	6a 1f                	push   $0x1f
  jmp __alltraps
c01028b7:	e9 60 09 00 00       	jmp    c010321c <__alltraps>

c01028bc <vector32>:
.globl vector32
vector32:
  pushl $0
c01028bc:	6a 00                	push   $0x0
  pushl $32
c01028be:	6a 20                	push   $0x20
  jmp __alltraps
c01028c0:	e9 57 09 00 00       	jmp    c010321c <__alltraps>

c01028c5 <vector33>:
.globl vector33
vector33:
  pushl $0
c01028c5:	6a 00                	push   $0x0
  pushl $33
c01028c7:	6a 21                	push   $0x21
  jmp __alltraps
c01028c9:	e9 4e 09 00 00       	jmp    c010321c <__alltraps>

c01028ce <vector34>:
.globl vector34
vector34:
  pushl $0
c01028ce:	6a 00                	push   $0x0
  pushl $34
c01028d0:	6a 22                	push   $0x22
  jmp __alltraps
c01028d2:	e9 45 09 00 00       	jmp    c010321c <__alltraps>

c01028d7 <vector35>:
.globl vector35
vector35:
  pushl $0
c01028d7:	6a 00                	push   $0x0
  pushl $35
c01028d9:	6a 23                	push   $0x23
  jmp __alltraps
c01028db:	e9 3c 09 00 00       	jmp    c010321c <__alltraps>

c01028e0 <vector36>:
.globl vector36
vector36:
  pushl $0
c01028e0:	6a 00                	push   $0x0
  pushl $36
c01028e2:	6a 24                	push   $0x24
  jmp __alltraps
c01028e4:	e9 33 09 00 00       	jmp    c010321c <__alltraps>

c01028e9 <vector37>:
.globl vector37
vector37:
  pushl $0
c01028e9:	6a 00                	push   $0x0
  pushl $37
c01028eb:	6a 25                	push   $0x25
  jmp __alltraps
c01028ed:	e9 2a 09 00 00       	jmp    c010321c <__alltraps>

c01028f2 <vector38>:
.globl vector38
vector38:
  pushl $0
c01028f2:	6a 00                	push   $0x0
  pushl $38
c01028f4:	6a 26                	push   $0x26
  jmp __alltraps
c01028f6:	e9 21 09 00 00       	jmp    c010321c <__alltraps>

c01028fb <vector39>:
.globl vector39
vector39:
  pushl $0
c01028fb:	6a 00                	push   $0x0
  pushl $39
c01028fd:	6a 27                	push   $0x27
  jmp __alltraps
c01028ff:	e9 18 09 00 00       	jmp    c010321c <__alltraps>

c0102904 <vector40>:
.globl vector40
vector40:
  pushl $0
c0102904:	6a 00                	push   $0x0
  pushl $40
c0102906:	6a 28                	push   $0x28
  jmp __alltraps
c0102908:	e9 0f 09 00 00       	jmp    c010321c <__alltraps>

c010290d <vector41>:
.globl vector41
vector41:
  pushl $0
c010290d:	6a 00                	push   $0x0
  pushl $41
c010290f:	6a 29                	push   $0x29
  jmp __alltraps
c0102911:	e9 06 09 00 00       	jmp    c010321c <__alltraps>

c0102916 <vector42>:
.globl vector42
vector42:
  pushl $0
c0102916:	6a 00                	push   $0x0
  pushl $42
c0102918:	6a 2a                	push   $0x2a
  jmp __alltraps
c010291a:	e9 fd 08 00 00       	jmp    c010321c <__alltraps>

c010291f <vector43>:
.globl vector43
vector43:
  pushl $0
c010291f:	6a 00                	push   $0x0
  pushl $43
c0102921:	6a 2b                	push   $0x2b
  jmp __alltraps
c0102923:	e9 f4 08 00 00       	jmp    c010321c <__alltraps>

c0102928 <vector44>:
.globl vector44
vector44:
  pushl $0
c0102928:	6a 00                	push   $0x0
  pushl $44
c010292a:	6a 2c                	push   $0x2c
  jmp __alltraps
c010292c:	e9 eb 08 00 00       	jmp    c010321c <__alltraps>

c0102931 <vector45>:
.globl vector45
vector45:
  pushl $0
c0102931:	6a 00                	push   $0x0
  pushl $45
c0102933:	6a 2d                	push   $0x2d
  jmp __alltraps
c0102935:	e9 e2 08 00 00       	jmp    c010321c <__alltraps>

c010293a <vector46>:
.globl vector46
vector46:
  pushl $0
c010293a:	6a 00                	push   $0x0
  pushl $46
c010293c:	6a 2e                	push   $0x2e
  jmp __alltraps
c010293e:	e9 d9 08 00 00       	jmp    c010321c <__alltraps>

c0102943 <vector47>:
.globl vector47
vector47:
  pushl $0
c0102943:	6a 00                	push   $0x0
  pushl $47
c0102945:	6a 2f                	push   $0x2f
  jmp __alltraps
c0102947:	e9 d0 08 00 00       	jmp    c010321c <__alltraps>

c010294c <vector48>:
.globl vector48
vector48:
  pushl $0
c010294c:	6a 00                	push   $0x0
  pushl $48
c010294e:	6a 30                	push   $0x30
  jmp __alltraps
c0102950:	e9 c7 08 00 00       	jmp    c010321c <__alltraps>

c0102955 <vector49>:
.globl vector49
vector49:
  pushl $0
c0102955:	6a 00                	push   $0x0
  pushl $49
c0102957:	6a 31                	push   $0x31
  jmp __alltraps
c0102959:	e9 be 08 00 00       	jmp    c010321c <__alltraps>

c010295e <vector50>:
.globl vector50
vector50:
  pushl $0
c010295e:	6a 00                	push   $0x0
  pushl $50
c0102960:	6a 32                	push   $0x32
  jmp __alltraps
c0102962:	e9 b5 08 00 00       	jmp    c010321c <__alltraps>

c0102967 <vector51>:
.globl vector51
vector51:
  pushl $0
c0102967:	6a 00                	push   $0x0
  pushl $51
c0102969:	6a 33                	push   $0x33
  jmp __alltraps
c010296b:	e9 ac 08 00 00       	jmp    c010321c <__alltraps>

c0102970 <vector52>:
.globl vector52
vector52:
  pushl $0
c0102970:	6a 00                	push   $0x0
  pushl $52
c0102972:	6a 34                	push   $0x34
  jmp __alltraps
c0102974:	e9 a3 08 00 00       	jmp    c010321c <__alltraps>

c0102979 <vector53>:
.globl vector53
vector53:
  pushl $0
c0102979:	6a 00                	push   $0x0
  pushl $53
c010297b:	6a 35                	push   $0x35
  jmp __alltraps
c010297d:	e9 9a 08 00 00       	jmp    c010321c <__alltraps>

c0102982 <vector54>:
.globl vector54
vector54:
  pushl $0
c0102982:	6a 00                	push   $0x0
  pushl $54
c0102984:	6a 36                	push   $0x36
  jmp __alltraps
c0102986:	e9 91 08 00 00       	jmp    c010321c <__alltraps>

c010298b <vector55>:
.globl vector55
vector55:
  pushl $0
c010298b:	6a 00                	push   $0x0
  pushl $55
c010298d:	6a 37                	push   $0x37
  jmp __alltraps
c010298f:	e9 88 08 00 00       	jmp    c010321c <__alltraps>

c0102994 <vector56>:
.globl vector56
vector56:
  pushl $0
c0102994:	6a 00                	push   $0x0
  pushl $56
c0102996:	6a 38                	push   $0x38
  jmp __alltraps
c0102998:	e9 7f 08 00 00       	jmp    c010321c <__alltraps>

c010299d <vector57>:
.globl vector57
vector57:
  pushl $0
c010299d:	6a 00                	push   $0x0
  pushl $57
c010299f:	6a 39                	push   $0x39
  jmp __alltraps
c01029a1:	e9 76 08 00 00       	jmp    c010321c <__alltraps>

c01029a6 <vector58>:
.globl vector58
vector58:
  pushl $0
c01029a6:	6a 00                	push   $0x0
  pushl $58
c01029a8:	6a 3a                	push   $0x3a
  jmp __alltraps
c01029aa:	e9 6d 08 00 00       	jmp    c010321c <__alltraps>

c01029af <vector59>:
.globl vector59
vector59:
  pushl $0
c01029af:	6a 00                	push   $0x0
  pushl $59
c01029b1:	6a 3b                	push   $0x3b
  jmp __alltraps
c01029b3:	e9 64 08 00 00       	jmp    c010321c <__alltraps>

c01029b8 <vector60>:
.globl vector60
vector60:
  pushl $0
c01029b8:	6a 00                	push   $0x0
  pushl $60
c01029ba:	6a 3c                	push   $0x3c
  jmp __alltraps
c01029bc:	e9 5b 08 00 00       	jmp    c010321c <__alltraps>

c01029c1 <vector61>:
.globl vector61
vector61:
  pushl $0
c01029c1:	6a 00                	push   $0x0
  pushl $61
c01029c3:	6a 3d                	push   $0x3d
  jmp __alltraps
c01029c5:	e9 52 08 00 00       	jmp    c010321c <__alltraps>

c01029ca <vector62>:
.globl vector62
vector62:
  pushl $0
c01029ca:	6a 00                	push   $0x0
  pushl $62
c01029cc:	6a 3e                	push   $0x3e
  jmp __alltraps
c01029ce:	e9 49 08 00 00       	jmp    c010321c <__alltraps>

c01029d3 <vector63>:
.globl vector63
vector63:
  pushl $0
c01029d3:	6a 00                	push   $0x0
  pushl $63
c01029d5:	6a 3f                	push   $0x3f
  jmp __alltraps
c01029d7:	e9 40 08 00 00       	jmp    c010321c <__alltraps>

c01029dc <vector64>:
.globl vector64
vector64:
  pushl $0
c01029dc:	6a 00                	push   $0x0
  pushl $64
c01029de:	6a 40                	push   $0x40
  jmp __alltraps
c01029e0:	e9 37 08 00 00       	jmp    c010321c <__alltraps>

c01029e5 <vector65>:
.globl vector65
vector65:
  pushl $0
c01029e5:	6a 00                	push   $0x0
  pushl $65
c01029e7:	6a 41                	push   $0x41
  jmp __alltraps
c01029e9:	e9 2e 08 00 00       	jmp    c010321c <__alltraps>

c01029ee <vector66>:
.globl vector66
vector66:
  pushl $0
c01029ee:	6a 00                	push   $0x0
  pushl $66
c01029f0:	6a 42                	push   $0x42
  jmp __alltraps
c01029f2:	e9 25 08 00 00       	jmp    c010321c <__alltraps>

c01029f7 <vector67>:
.globl vector67
vector67:
  pushl $0
c01029f7:	6a 00                	push   $0x0
  pushl $67
c01029f9:	6a 43                	push   $0x43
  jmp __alltraps
c01029fb:	e9 1c 08 00 00       	jmp    c010321c <__alltraps>

c0102a00 <vector68>:
.globl vector68
vector68:
  pushl $0
c0102a00:	6a 00                	push   $0x0
  pushl $68
c0102a02:	6a 44                	push   $0x44
  jmp __alltraps
c0102a04:	e9 13 08 00 00       	jmp    c010321c <__alltraps>

c0102a09 <vector69>:
.globl vector69
vector69:
  pushl $0
c0102a09:	6a 00                	push   $0x0
  pushl $69
c0102a0b:	6a 45                	push   $0x45
  jmp __alltraps
c0102a0d:	e9 0a 08 00 00       	jmp    c010321c <__alltraps>

c0102a12 <vector70>:
.globl vector70
vector70:
  pushl $0
c0102a12:	6a 00                	push   $0x0
  pushl $70
c0102a14:	6a 46                	push   $0x46
  jmp __alltraps
c0102a16:	e9 01 08 00 00       	jmp    c010321c <__alltraps>

c0102a1b <vector71>:
.globl vector71
vector71:
  pushl $0
c0102a1b:	6a 00                	push   $0x0
  pushl $71
c0102a1d:	6a 47                	push   $0x47
  jmp __alltraps
c0102a1f:	e9 f8 07 00 00       	jmp    c010321c <__alltraps>

c0102a24 <vector72>:
.globl vector72
vector72:
  pushl $0
c0102a24:	6a 00                	push   $0x0
  pushl $72
c0102a26:	6a 48                	push   $0x48
  jmp __alltraps
c0102a28:	e9 ef 07 00 00       	jmp    c010321c <__alltraps>

c0102a2d <vector73>:
.globl vector73
vector73:
  pushl $0
c0102a2d:	6a 00                	push   $0x0
  pushl $73
c0102a2f:	6a 49                	push   $0x49
  jmp __alltraps
c0102a31:	e9 e6 07 00 00       	jmp    c010321c <__alltraps>

c0102a36 <vector74>:
.globl vector74
vector74:
  pushl $0
c0102a36:	6a 00                	push   $0x0
  pushl $74
c0102a38:	6a 4a                	push   $0x4a
  jmp __alltraps
c0102a3a:	e9 dd 07 00 00       	jmp    c010321c <__alltraps>

c0102a3f <vector75>:
.globl vector75
vector75:
  pushl $0
c0102a3f:	6a 00                	push   $0x0
  pushl $75
c0102a41:	6a 4b                	push   $0x4b
  jmp __alltraps
c0102a43:	e9 d4 07 00 00       	jmp    c010321c <__alltraps>

c0102a48 <vector76>:
.globl vector76
vector76:
  pushl $0
c0102a48:	6a 00                	push   $0x0
  pushl $76
c0102a4a:	6a 4c                	push   $0x4c
  jmp __alltraps
c0102a4c:	e9 cb 07 00 00       	jmp    c010321c <__alltraps>

c0102a51 <vector77>:
.globl vector77
vector77:
  pushl $0
c0102a51:	6a 00                	push   $0x0
  pushl $77
c0102a53:	6a 4d                	push   $0x4d
  jmp __alltraps
c0102a55:	e9 c2 07 00 00       	jmp    c010321c <__alltraps>

c0102a5a <vector78>:
.globl vector78
vector78:
  pushl $0
c0102a5a:	6a 00                	push   $0x0
  pushl $78
c0102a5c:	6a 4e                	push   $0x4e
  jmp __alltraps
c0102a5e:	e9 b9 07 00 00       	jmp    c010321c <__alltraps>

c0102a63 <vector79>:
.globl vector79
vector79:
  pushl $0
c0102a63:	6a 00                	push   $0x0
  pushl $79
c0102a65:	6a 4f                	push   $0x4f
  jmp __alltraps
c0102a67:	e9 b0 07 00 00       	jmp    c010321c <__alltraps>

c0102a6c <vector80>:
.globl vector80
vector80:
  pushl $0
c0102a6c:	6a 00                	push   $0x0
  pushl $80
c0102a6e:	6a 50                	push   $0x50
  jmp __alltraps
c0102a70:	e9 a7 07 00 00       	jmp    c010321c <__alltraps>

c0102a75 <vector81>:
.globl vector81
vector81:
  pushl $0
c0102a75:	6a 00                	push   $0x0
  pushl $81
c0102a77:	6a 51                	push   $0x51
  jmp __alltraps
c0102a79:	e9 9e 07 00 00       	jmp    c010321c <__alltraps>

c0102a7e <vector82>:
.globl vector82
vector82:
  pushl $0
c0102a7e:	6a 00                	push   $0x0
  pushl $82
c0102a80:	6a 52                	push   $0x52
  jmp __alltraps
c0102a82:	e9 95 07 00 00       	jmp    c010321c <__alltraps>

c0102a87 <vector83>:
.globl vector83
vector83:
  pushl $0
c0102a87:	6a 00                	push   $0x0
  pushl $83
c0102a89:	6a 53                	push   $0x53
  jmp __alltraps
c0102a8b:	e9 8c 07 00 00       	jmp    c010321c <__alltraps>

c0102a90 <vector84>:
.globl vector84
vector84:
  pushl $0
c0102a90:	6a 00                	push   $0x0
  pushl $84
c0102a92:	6a 54                	push   $0x54
  jmp __alltraps
c0102a94:	e9 83 07 00 00       	jmp    c010321c <__alltraps>

c0102a99 <vector85>:
.globl vector85
vector85:
  pushl $0
c0102a99:	6a 00                	push   $0x0
  pushl $85
c0102a9b:	6a 55                	push   $0x55
  jmp __alltraps
c0102a9d:	e9 7a 07 00 00       	jmp    c010321c <__alltraps>

c0102aa2 <vector86>:
.globl vector86
vector86:
  pushl $0
c0102aa2:	6a 00                	push   $0x0
  pushl $86
c0102aa4:	6a 56                	push   $0x56
  jmp __alltraps
c0102aa6:	e9 71 07 00 00       	jmp    c010321c <__alltraps>

c0102aab <vector87>:
.globl vector87
vector87:
  pushl $0
c0102aab:	6a 00                	push   $0x0
  pushl $87
c0102aad:	6a 57                	push   $0x57
  jmp __alltraps
c0102aaf:	e9 68 07 00 00       	jmp    c010321c <__alltraps>

c0102ab4 <vector88>:
.globl vector88
vector88:
  pushl $0
c0102ab4:	6a 00                	push   $0x0
  pushl $88
c0102ab6:	6a 58                	push   $0x58
  jmp __alltraps
c0102ab8:	e9 5f 07 00 00       	jmp    c010321c <__alltraps>

c0102abd <vector89>:
.globl vector89
vector89:
  pushl $0
c0102abd:	6a 00                	push   $0x0
  pushl $89
c0102abf:	6a 59                	push   $0x59
  jmp __alltraps
c0102ac1:	e9 56 07 00 00       	jmp    c010321c <__alltraps>

c0102ac6 <vector90>:
.globl vector90
vector90:
  pushl $0
c0102ac6:	6a 00                	push   $0x0
  pushl $90
c0102ac8:	6a 5a                	push   $0x5a
  jmp __alltraps
c0102aca:	e9 4d 07 00 00       	jmp    c010321c <__alltraps>

c0102acf <vector91>:
.globl vector91
vector91:
  pushl $0
c0102acf:	6a 00                	push   $0x0
  pushl $91
c0102ad1:	6a 5b                	push   $0x5b
  jmp __alltraps
c0102ad3:	e9 44 07 00 00       	jmp    c010321c <__alltraps>

c0102ad8 <vector92>:
.globl vector92
vector92:
  pushl $0
c0102ad8:	6a 00                	push   $0x0
  pushl $92
c0102ada:	6a 5c                	push   $0x5c
  jmp __alltraps
c0102adc:	e9 3b 07 00 00       	jmp    c010321c <__alltraps>

c0102ae1 <vector93>:
.globl vector93
vector93:
  pushl $0
c0102ae1:	6a 00                	push   $0x0
  pushl $93
c0102ae3:	6a 5d                	push   $0x5d
  jmp __alltraps
c0102ae5:	e9 32 07 00 00       	jmp    c010321c <__alltraps>

c0102aea <vector94>:
.globl vector94
vector94:
  pushl $0
c0102aea:	6a 00                	push   $0x0
  pushl $94
c0102aec:	6a 5e                	push   $0x5e
  jmp __alltraps
c0102aee:	e9 29 07 00 00       	jmp    c010321c <__alltraps>

c0102af3 <vector95>:
.globl vector95
vector95:
  pushl $0
c0102af3:	6a 00                	push   $0x0
  pushl $95
c0102af5:	6a 5f                	push   $0x5f
  jmp __alltraps
c0102af7:	e9 20 07 00 00       	jmp    c010321c <__alltraps>

c0102afc <vector96>:
.globl vector96
vector96:
  pushl $0
c0102afc:	6a 00                	push   $0x0
  pushl $96
c0102afe:	6a 60                	push   $0x60
  jmp __alltraps
c0102b00:	e9 17 07 00 00       	jmp    c010321c <__alltraps>

c0102b05 <vector97>:
.globl vector97
vector97:
  pushl $0
c0102b05:	6a 00                	push   $0x0
  pushl $97
c0102b07:	6a 61                	push   $0x61
  jmp __alltraps
c0102b09:	e9 0e 07 00 00       	jmp    c010321c <__alltraps>

c0102b0e <vector98>:
.globl vector98
vector98:
  pushl $0
c0102b0e:	6a 00                	push   $0x0
  pushl $98
c0102b10:	6a 62                	push   $0x62
  jmp __alltraps
c0102b12:	e9 05 07 00 00       	jmp    c010321c <__alltraps>

c0102b17 <vector99>:
.globl vector99
vector99:
  pushl $0
c0102b17:	6a 00                	push   $0x0
  pushl $99
c0102b19:	6a 63                	push   $0x63
  jmp __alltraps
c0102b1b:	e9 fc 06 00 00       	jmp    c010321c <__alltraps>

c0102b20 <vector100>:
.globl vector100
vector100:
  pushl $0
c0102b20:	6a 00                	push   $0x0
  pushl $100
c0102b22:	6a 64                	push   $0x64
  jmp __alltraps
c0102b24:	e9 f3 06 00 00       	jmp    c010321c <__alltraps>

c0102b29 <vector101>:
.globl vector101
vector101:
  pushl $0
c0102b29:	6a 00                	push   $0x0
  pushl $101
c0102b2b:	6a 65                	push   $0x65
  jmp __alltraps
c0102b2d:	e9 ea 06 00 00       	jmp    c010321c <__alltraps>

c0102b32 <vector102>:
.globl vector102
vector102:
  pushl $0
c0102b32:	6a 00                	push   $0x0
  pushl $102
c0102b34:	6a 66                	push   $0x66
  jmp __alltraps
c0102b36:	e9 e1 06 00 00       	jmp    c010321c <__alltraps>

c0102b3b <vector103>:
.globl vector103
vector103:
  pushl $0
c0102b3b:	6a 00                	push   $0x0
  pushl $103
c0102b3d:	6a 67                	push   $0x67
  jmp __alltraps
c0102b3f:	e9 d8 06 00 00       	jmp    c010321c <__alltraps>

c0102b44 <vector104>:
.globl vector104
vector104:
  pushl $0
c0102b44:	6a 00                	push   $0x0
  pushl $104
c0102b46:	6a 68                	push   $0x68
  jmp __alltraps
c0102b48:	e9 cf 06 00 00       	jmp    c010321c <__alltraps>

c0102b4d <vector105>:
.globl vector105
vector105:
  pushl $0
c0102b4d:	6a 00                	push   $0x0
  pushl $105
c0102b4f:	6a 69                	push   $0x69
  jmp __alltraps
c0102b51:	e9 c6 06 00 00       	jmp    c010321c <__alltraps>

c0102b56 <vector106>:
.globl vector106
vector106:
  pushl $0
c0102b56:	6a 00                	push   $0x0
  pushl $106
c0102b58:	6a 6a                	push   $0x6a
  jmp __alltraps
c0102b5a:	e9 bd 06 00 00       	jmp    c010321c <__alltraps>

c0102b5f <vector107>:
.globl vector107
vector107:
  pushl $0
c0102b5f:	6a 00                	push   $0x0
  pushl $107
c0102b61:	6a 6b                	push   $0x6b
  jmp __alltraps
c0102b63:	e9 b4 06 00 00       	jmp    c010321c <__alltraps>

c0102b68 <vector108>:
.globl vector108
vector108:
  pushl $0
c0102b68:	6a 00                	push   $0x0
  pushl $108
c0102b6a:	6a 6c                	push   $0x6c
  jmp __alltraps
c0102b6c:	e9 ab 06 00 00       	jmp    c010321c <__alltraps>

c0102b71 <vector109>:
.globl vector109
vector109:
  pushl $0
c0102b71:	6a 00                	push   $0x0
  pushl $109
c0102b73:	6a 6d                	push   $0x6d
  jmp __alltraps
c0102b75:	e9 a2 06 00 00       	jmp    c010321c <__alltraps>

c0102b7a <vector110>:
.globl vector110
vector110:
  pushl $0
c0102b7a:	6a 00                	push   $0x0
  pushl $110
c0102b7c:	6a 6e                	push   $0x6e
  jmp __alltraps
c0102b7e:	e9 99 06 00 00       	jmp    c010321c <__alltraps>

c0102b83 <vector111>:
.globl vector111
vector111:
  pushl $0
c0102b83:	6a 00                	push   $0x0
  pushl $111
c0102b85:	6a 6f                	push   $0x6f
  jmp __alltraps
c0102b87:	e9 90 06 00 00       	jmp    c010321c <__alltraps>

c0102b8c <vector112>:
.globl vector112
vector112:
  pushl $0
c0102b8c:	6a 00                	push   $0x0
  pushl $112
c0102b8e:	6a 70                	push   $0x70
  jmp __alltraps
c0102b90:	e9 87 06 00 00       	jmp    c010321c <__alltraps>

c0102b95 <vector113>:
.globl vector113
vector113:
  pushl $0
c0102b95:	6a 00                	push   $0x0
  pushl $113
c0102b97:	6a 71                	push   $0x71
  jmp __alltraps
c0102b99:	e9 7e 06 00 00       	jmp    c010321c <__alltraps>

c0102b9e <vector114>:
.globl vector114
vector114:
  pushl $0
c0102b9e:	6a 00                	push   $0x0
  pushl $114
c0102ba0:	6a 72                	push   $0x72
  jmp __alltraps
c0102ba2:	e9 75 06 00 00       	jmp    c010321c <__alltraps>

c0102ba7 <vector115>:
.globl vector115
vector115:
  pushl $0
c0102ba7:	6a 00                	push   $0x0
  pushl $115
c0102ba9:	6a 73                	push   $0x73
  jmp __alltraps
c0102bab:	e9 6c 06 00 00       	jmp    c010321c <__alltraps>

c0102bb0 <vector116>:
.globl vector116
vector116:
  pushl $0
c0102bb0:	6a 00                	push   $0x0
  pushl $116
c0102bb2:	6a 74                	push   $0x74
  jmp __alltraps
c0102bb4:	e9 63 06 00 00       	jmp    c010321c <__alltraps>

c0102bb9 <vector117>:
.globl vector117
vector117:
  pushl $0
c0102bb9:	6a 00                	push   $0x0
  pushl $117
c0102bbb:	6a 75                	push   $0x75
  jmp __alltraps
c0102bbd:	e9 5a 06 00 00       	jmp    c010321c <__alltraps>

c0102bc2 <vector118>:
.globl vector118
vector118:
  pushl $0
c0102bc2:	6a 00                	push   $0x0
  pushl $118
c0102bc4:	6a 76                	push   $0x76
  jmp __alltraps
c0102bc6:	e9 51 06 00 00       	jmp    c010321c <__alltraps>

c0102bcb <vector119>:
.globl vector119
vector119:
  pushl $0
c0102bcb:	6a 00                	push   $0x0
  pushl $119
c0102bcd:	6a 77                	push   $0x77
  jmp __alltraps
c0102bcf:	e9 48 06 00 00       	jmp    c010321c <__alltraps>

c0102bd4 <vector120>:
.globl vector120
vector120:
  pushl $0
c0102bd4:	6a 00                	push   $0x0
  pushl $120
c0102bd6:	6a 78                	push   $0x78
  jmp __alltraps
c0102bd8:	e9 3f 06 00 00       	jmp    c010321c <__alltraps>

c0102bdd <vector121>:
.globl vector121
vector121:
  pushl $0
c0102bdd:	6a 00                	push   $0x0
  pushl $121
c0102bdf:	6a 79                	push   $0x79
  jmp __alltraps
c0102be1:	e9 36 06 00 00       	jmp    c010321c <__alltraps>

c0102be6 <vector122>:
.globl vector122
vector122:
  pushl $0
c0102be6:	6a 00                	push   $0x0
  pushl $122
c0102be8:	6a 7a                	push   $0x7a
  jmp __alltraps
c0102bea:	e9 2d 06 00 00       	jmp    c010321c <__alltraps>

c0102bef <vector123>:
.globl vector123
vector123:
  pushl $0
c0102bef:	6a 00                	push   $0x0
  pushl $123
c0102bf1:	6a 7b                	push   $0x7b
  jmp __alltraps
c0102bf3:	e9 24 06 00 00       	jmp    c010321c <__alltraps>

c0102bf8 <vector124>:
.globl vector124
vector124:
  pushl $0
c0102bf8:	6a 00                	push   $0x0
  pushl $124
c0102bfa:	6a 7c                	push   $0x7c
  jmp __alltraps
c0102bfc:	e9 1b 06 00 00       	jmp    c010321c <__alltraps>

c0102c01 <vector125>:
.globl vector125
vector125:
  pushl $0
c0102c01:	6a 00                	push   $0x0
  pushl $125
c0102c03:	6a 7d                	push   $0x7d
  jmp __alltraps
c0102c05:	e9 12 06 00 00       	jmp    c010321c <__alltraps>

c0102c0a <vector126>:
.globl vector126
vector126:
  pushl $0
c0102c0a:	6a 00                	push   $0x0
  pushl $126
c0102c0c:	6a 7e                	push   $0x7e
  jmp __alltraps
c0102c0e:	e9 09 06 00 00       	jmp    c010321c <__alltraps>

c0102c13 <vector127>:
.globl vector127
vector127:
  pushl $0
c0102c13:	6a 00                	push   $0x0
  pushl $127
c0102c15:	6a 7f                	push   $0x7f
  jmp __alltraps
c0102c17:	e9 00 06 00 00       	jmp    c010321c <__alltraps>

c0102c1c <vector128>:
.globl vector128
vector128:
  pushl $0
c0102c1c:	6a 00                	push   $0x0
  pushl $128
c0102c1e:	68 80 00 00 00       	push   $0x80
  jmp __alltraps
c0102c23:	e9 f4 05 00 00       	jmp    c010321c <__alltraps>

c0102c28 <vector129>:
.globl vector129
vector129:
  pushl $0
c0102c28:	6a 00                	push   $0x0
  pushl $129
c0102c2a:	68 81 00 00 00       	push   $0x81
  jmp __alltraps
c0102c2f:	e9 e8 05 00 00       	jmp    c010321c <__alltraps>

c0102c34 <vector130>:
.globl vector130
vector130:
  pushl $0
c0102c34:	6a 00                	push   $0x0
  pushl $130
c0102c36:	68 82 00 00 00       	push   $0x82
  jmp __alltraps
c0102c3b:	e9 dc 05 00 00       	jmp    c010321c <__alltraps>

c0102c40 <vector131>:
.globl vector131
vector131:
  pushl $0
c0102c40:	6a 00                	push   $0x0
  pushl $131
c0102c42:	68 83 00 00 00       	push   $0x83
  jmp __alltraps
c0102c47:	e9 d0 05 00 00       	jmp    c010321c <__alltraps>

c0102c4c <vector132>:
.globl vector132
vector132:
  pushl $0
c0102c4c:	6a 00                	push   $0x0
  pushl $132
c0102c4e:	68 84 00 00 00       	push   $0x84
  jmp __alltraps
c0102c53:	e9 c4 05 00 00       	jmp    c010321c <__alltraps>

c0102c58 <vector133>:
.globl vector133
vector133:
  pushl $0
c0102c58:	6a 00                	push   $0x0
  pushl $133
c0102c5a:	68 85 00 00 00       	push   $0x85
  jmp __alltraps
c0102c5f:	e9 b8 05 00 00       	jmp    c010321c <__alltraps>

c0102c64 <vector134>:
.globl vector134
vector134:
  pushl $0
c0102c64:	6a 00                	push   $0x0
  pushl $134
c0102c66:	68 86 00 00 00       	push   $0x86
  jmp __alltraps
c0102c6b:	e9 ac 05 00 00       	jmp    c010321c <__alltraps>

c0102c70 <vector135>:
.globl vector135
vector135:
  pushl $0
c0102c70:	6a 00                	push   $0x0
  pushl $135
c0102c72:	68 87 00 00 00       	push   $0x87
  jmp __alltraps
c0102c77:	e9 a0 05 00 00       	jmp    c010321c <__alltraps>

c0102c7c <vector136>:
.globl vector136
vector136:
  pushl $0
c0102c7c:	6a 00                	push   $0x0
  pushl $136
c0102c7e:	68 88 00 00 00       	push   $0x88
  jmp __alltraps
c0102c83:	e9 94 05 00 00       	jmp    c010321c <__alltraps>

c0102c88 <vector137>:
.globl vector137
vector137:
  pushl $0
c0102c88:	6a 00                	push   $0x0
  pushl $137
c0102c8a:	68 89 00 00 00       	push   $0x89
  jmp __alltraps
c0102c8f:	e9 88 05 00 00       	jmp    c010321c <__alltraps>

c0102c94 <vector138>:
.globl vector138
vector138:
  pushl $0
c0102c94:	6a 00                	push   $0x0
  pushl $138
c0102c96:	68 8a 00 00 00       	push   $0x8a
  jmp __alltraps
c0102c9b:	e9 7c 05 00 00       	jmp    c010321c <__alltraps>

c0102ca0 <vector139>:
.globl vector139
vector139:
  pushl $0
c0102ca0:	6a 00                	push   $0x0
  pushl $139
c0102ca2:	68 8b 00 00 00       	push   $0x8b
  jmp __alltraps
c0102ca7:	e9 70 05 00 00       	jmp    c010321c <__alltraps>

c0102cac <vector140>:
.globl vector140
vector140:
  pushl $0
c0102cac:	6a 00                	push   $0x0
  pushl $140
c0102cae:	68 8c 00 00 00       	push   $0x8c
  jmp __alltraps
c0102cb3:	e9 64 05 00 00       	jmp    c010321c <__alltraps>

c0102cb8 <vector141>:
.globl vector141
vector141:
  pushl $0
c0102cb8:	6a 00                	push   $0x0
  pushl $141
c0102cba:	68 8d 00 00 00       	push   $0x8d
  jmp __alltraps
c0102cbf:	e9 58 05 00 00       	jmp    c010321c <__alltraps>

c0102cc4 <vector142>:
.globl vector142
vector142:
  pushl $0
c0102cc4:	6a 00                	push   $0x0
  pushl $142
c0102cc6:	68 8e 00 00 00       	push   $0x8e
  jmp __alltraps
c0102ccb:	e9 4c 05 00 00       	jmp    c010321c <__alltraps>

c0102cd0 <vector143>:
.globl vector143
vector143:
  pushl $0
c0102cd0:	6a 00                	push   $0x0
  pushl $143
c0102cd2:	68 8f 00 00 00       	push   $0x8f
  jmp __alltraps
c0102cd7:	e9 40 05 00 00       	jmp    c010321c <__alltraps>

c0102cdc <vector144>:
.globl vector144
vector144:
  pushl $0
c0102cdc:	6a 00                	push   $0x0
  pushl $144
c0102cde:	68 90 00 00 00       	push   $0x90
  jmp __alltraps
c0102ce3:	e9 34 05 00 00       	jmp    c010321c <__alltraps>

c0102ce8 <vector145>:
.globl vector145
vector145:
  pushl $0
c0102ce8:	6a 00                	push   $0x0
  pushl $145
c0102cea:	68 91 00 00 00       	push   $0x91
  jmp __alltraps
c0102cef:	e9 28 05 00 00       	jmp    c010321c <__alltraps>

c0102cf4 <vector146>:
.globl vector146
vector146:
  pushl $0
c0102cf4:	6a 00                	push   $0x0
  pushl $146
c0102cf6:	68 92 00 00 00       	push   $0x92
  jmp __alltraps
c0102cfb:	e9 1c 05 00 00       	jmp    c010321c <__alltraps>

c0102d00 <vector147>:
.globl vector147
vector147:
  pushl $0
c0102d00:	6a 00                	push   $0x0
  pushl $147
c0102d02:	68 93 00 00 00       	push   $0x93
  jmp __alltraps
c0102d07:	e9 10 05 00 00       	jmp    c010321c <__alltraps>

c0102d0c <vector148>:
.globl vector148
vector148:
  pushl $0
c0102d0c:	6a 00                	push   $0x0
  pushl $148
c0102d0e:	68 94 00 00 00       	push   $0x94
  jmp __alltraps
c0102d13:	e9 04 05 00 00       	jmp    c010321c <__alltraps>

c0102d18 <vector149>:
.globl vector149
vector149:
  pushl $0
c0102d18:	6a 00                	push   $0x0
  pushl $149
c0102d1a:	68 95 00 00 00       	push   $0x95
  jmp __alltraps
c0102d1f:	e9 f8 04 00 00       	jmp    c010321c <__alltraps>

c0102d24 <vector150>:
.globl vector150
vector150:
  pushl $0
c0102d24:	6a 00                	push   $0x0
  pushl $150
c0102d26:	68 96 00 00 00       	push   $0x96
  jmp __alltraps
c0102d2b:	e9 ec 04 00 00       	jmp    c010321c <__alltraps>

c0102d30 <vector151>:
.globl vector151
vector151:
  pushl $0
c0102d30:	6a 00                	push   $0x0
  pushl $151
c0102d32:	68 97 00 00 00       	push   $0x97
  jmp __alltraps
c0102d37:	e9 e0 04 00 00       	jmp    c010321c <__alltraps>

c0102d3c <vector152>:
.globl vector152
vector152:
  pushl $0
c0102d3c:	6a 00                	push   $0x0
  pushl $152
c0102d3e:	68 98 00 00 00       	push   $0x98
  jmp __alltraps
c0102d43:	e9 d4 04 00 00       	jmp    c010321c <__alltraps>

c0102d48 <vector153>:
.globl vector153
vector153:
  pushl $0
c0102d48:	6a 00                	push   $0x0
  pushl $153
c0102d4a:	68 99 00 00 00       	push   $0x99
  jmp __alltraps
c0102d4f:	e9 c8 04 00 00       	jmp    c010321c <__alltraps>

c0102d54 <vector154>:
.globl vector154
vector154:
  pushl $0
c0102d54:	6a 00                	push   $0x0
  pushl $154
c0102d56:	68 9a 00 00 00       	push   $0x9a
  jmp __alltraps
c0102d5b:	e9 bc 04 00 00       	jmp    c010321c <__alltraps>

c0102d60 <vector155>:
.globl vector155
vector155:
  pushl $0
c0102d60:	6a 00                	push   $0x0
  pushl $155
c0102d62:	68 9b 00 00 00       	push   $0x9b
  jmp __alltraps
c0102d67:	e9 b0 04 00 00       	jmp    c010321c <__alltraps>

c0102d6c <vector156>:
.globl vector156
vector156:
  pushl $0
c0102d6c:	6a 00                	push   $0x0
  pushl $156
c0102d6e:	68 9c 00 00 00       	push   $0x9c
  jmp __alltraps
c0102d73:	e9 a4 04 00 00       	jmp    c010321c <__alltraps>

c0102d78 <vector157>:
.globl vector157
vector157:
  pushl $0
c0102d78:	6a 00                	push   $0x0
  pushl $157
c0102d7a:	68 9d 00 00 00       	push   $0x9d
  jmp __alltraps
c0102d7f:	e9 98 04 00 00       	jmp    c010321c <__alltraps>

c0102d84 <vector158>:
.globl vector158
vector158:
  pushl $0
c0102d84:	6a 00                	push   $0x0
  pushl $158
c0102d86:	68 9e 00 00 00       	push   $0x9e
  jmp __alltraps
c0102d8b:	e9 8c 04 00 00       	jmp    c010321c <__alltraps>

c0102d90 <vector159>:
.globl vector159
vector159:
  pushl $0
c0102d90:	6a 00                	push   $0x0
  pushl $159
c0102d92:	68 9f 00 00 00       	push   $0x9f
  jmp __alltraps
c0102d97:	e9 80 04 00 00       	jmp    c010321c <__alltraps>

c0102d9c <vector160>:
.globl vector160
vector160:
  pushl $0
c0102d9c:	6a 00                	push   $0x0
  pushl $160
c0102d9e:	68 a0 00 00 00       	push   $0xa0
  jmp __alltraps
c0102da3:	e9 74 04 00 00       	jmp    c010321c <__alltraps>

c0102da8 <vector161>:
.globl vector161
vector161:
  pushl $0
c0102da8:	6a 00                	push   $0x0
  pushl $161
c0102daa:	68 a1 00 00 00       	push   $0xa1
  jmp __alltraps
c0102daf:	e9 68 04 00 00       	jmp    c010321c <__alltraps>

c0102db4 <vector162>:
.globl vector162
vector162:
  pushl $0
c0102db4:	6a 00                	push   $0x0
  pushl $162
c0102db6:	68 a2 00 00 00       	push   $0xa2
  jmp __alltraps
c0102dbb:	e9 5c 04 00 00       	jmp    c010321c <__alltraps>

c0102dc0 <vector163>:
.globl vector163
vector163:
  pushl $0
c0102dc0:	6a 00                	push   $0x0
  pushl $163
c0102dc2:	68 a3 00 00 00       	push   $0xa3
  jmp __alltraps
c0102dc7:	e9 50 04 00 00       	jmp    c010321c <__alltraps>

c0102dcc <vector164>:
.globl vector164
vector164:
  pushl $0
c0102dcc:	6a 00                	push   $0x0
  pushl $164
c0102dce:	68 a4 00 00 00       	push   $0xa4
  jmp __alltraps
c0102dd3:	e9 44 04 00 00       	jmp    c010321c <__alltraps>

c0102dd8 <vector165>:
.globl vector165
vector165:
  pushl $0
c0102dd8:	6a 00                	push   $0x0
  pushl $165
c0102dda:	68 a5 00 00 00       	push   $0xa5
  jmp __alltraps
c0102ddf:	e9 38 04 00 00       	jmp    c010321c <__alltraps>

c0102de4 <vector166>:
.globl vector166
vector166:
  pushl $0
c0102de4:	6a 00                	push   $0x0
  pushl $166
c0102de6:	68 a6 00 00 00       	push   $0xa6
  jmp __alltraps
c0102deb:	e9 2c 04 00 00       	jmp    c010321c <__alltraps>

c0102df0 <vector167>:
.globl vector167
vector167:
  pushl $0
c0102df0:	6a 00                	push   $0x0
  pushl $167
c0102df2:	68 a7 00 00 00       	push   $0xa7
  jmp __alltraps
c0102df7:	e9 20 04 00 00       	jmp    c010321c <__alltraps>

c0102dfc <vector168>:
.globl vector168
vector168:
  pushl $0
c0102dfc:	6a 00                	push   $0x0
  pushl $168
c0102dfe:	68 a8 00 00 00       	push   $0xa8
  jmp __alltraps
c0102e03:	e9 14 04 00 00       	jmp    c010321c <__alltraps>

c0102e08 <vector169>:
.globl vector169
vector169:
  pushl $0
c0102e08:	6a 00                	push   $0x0
  pushl $169
c0102e0a:	68 a9 00 00 00       	push   $0xa9
  jmp __alltraps
c0102e0f:	e9 08 04 00 00       	jmp    c010321c <__alltraps>

c0102e14 <vector170>:
.globl vector170
vector170:
  pushl $0
c0102e14:	6a 00                	push   $0x0
  pushl $170
c0102e16:	68 aa 00 00 00       	push   $0xaa
  jmp __alltraps
c0102e1b:	e9 fc 03 00 00       	jmp    c010321c <__alltraps>

c0102e20 <vector171>:
.globl vector171
vector171:
  pushl $0
c0102e20:	6a 00                	push   $0x0
  pushl $171
c0102e22:	68 ab 00 00 00       	push   $0xab
  jmp __alltraps
c0102e27:	e9 f0 03 00 00       	jmp    c010321c <__alltraps>

c0102e2c <vector172>:
.globl vector172
vector172:
  pushl $0
c0102e2c:	6a 00                	push   $0x0
  pushl $172
c0102e2e:	68 ac 00 00 00       	push   $0xac
  jmp __alltraps
c0102e33:	e9 e4 03 00 00       	jmp    c010321c <__alltraps>

c0102e38 <vector173>:
.globl vector173
vector173:
  pushl $0
c0102e38:	6a 00                	push   $0x0
  pushl $173
c0102e3a:	68 ad 00 00 00       	push   $0xad
  jmp __alltraps
c0102e3f:	e9 d8 03 00 00       	jmp    c010321c <__alltraps>

c0102e44 <vector174>:
.globl vector174
vector174:
  pushl $0
c0102e44:	6a 00                	push   $0x0
  pushl $174
c0102e46:	68 ae 00 00 00       	push   $0xae
  jmp __alltraps
c0102e4b:	e9 cc 03 00 00       	jmp    c010321c <__alltraps>

c0102e50 <vector175>:
.globl vector175
vector175:
  pushl $0
c0102e50:	6a 00                	push   $0x0
  pushl $175
c0102e52:	68 af 00 00 00       	push   $0xaf
  jmp __alltraps
c0102e57:	e9 c0 03 00 00       	jmp    c010321c <__alltraps>

c0102e5c <vector176>:
.globl vector176
vector176:
  pushl $0
c0102e5c:	6a 00                	push   $0x0
  pushl $176
c0102e5e:	68 b0 00 00 00       	push   $0xb0
  jmp __alltraps
c0102e63:	e9 b4 03 00 00       	jmp    c010321c <__alltraps>

c0102e68 <vector177>:
.globl vector177
vector177:
  pushl $0
c0102e68:	6a 00                	push   $0x0
  pushl $177
c0102e6a:	68 b1 00 00 00       	push   $0xb1
  jmp __alltraps
c0102e6f:	e9 a8 03 00 00       	jmp    c010321c <__alltraps>

c0102e74 <vector178>:
.globl vector178
vector178:
  pushl $0
c0102e74:	6a 00                	push   $0x0
  pushl $178
c0102e76:	68 b2 00 00 00       	push   $0xb2
  jmp __alltraps
c0102e7b:	e9 9c 03 00 00       	jmp    c010321c <__alltraps>

c0102e80 <vector179>:
.globl vector179
vector179:
  pushl $0
c0102e80:	6a 00                	push   $0x0
  pushl $179
c0102e82:	68 b3 00 00 00       	push   $0xb3
  jmp __alltraps
c0102e87:	e9 90 03 00 00       	jmp    c010321c <__alltraps>

c0102e8c <vector180>:
.globl vector180
vector180:
  pushl $0
c0102e8c:	6a 00                	push   $0x0
  pushl $180
c0102e8e:	68 b4 00 00 00       	push   $0xb4
  jmp __alltraps
c0102e93:	e9 84 03 00 00       	jmp    c010321c <__alltraps>

c0102e98 <vector181>:
.globl vector181
vector181:
  pushl $0
c0102e98:	6a 00                	push   $0x0
  pushl $181
c0102e9a:	68 b5 00 00 00       	push   $0xb5
  jmp __alltraps
c0102e9f:	e9 78 03 00 00       	jmp    c010321c <__alltraps>

c0102ea4 <vector182>:
.globl vector182
vector182:
  pushl $0
c0102ea4:	6a 00                	push   $0x0
  pushl $182
c0102ea6:	68 b6 00 00 00       	push   $0xb6
  jmp __alltraps
c0102eab:	e9 6c 03 00 00       	jmp    c010321c <__alltraps>

c0102eb0 <vector183>:
.globl vector183
vector183:
  pushl $0
c0102eb0:	6a 00                	push   $0x0
  pushl $183
c0102eb2:	68 b7 00 00 00       	push   $0xb7
  jmp __alltraps
c0102eb7:	e9 60 03 00 00       	jmp    c010321c <__alltraps>

c0102ebc <vector184>:
.globl vector184
vector184:
  pushl $0
c0102ebc:	6a 00                	push   $0x0
  pushl $184
c0102ebe:	68 b8 00 00 00       	push   $0xb8
  jmp __alltraps
c0102ec3:	e9 54 03 00 00       	jmp    c010321c <__alltraps>

c0102ec8 <vector185>:
.globl vector185
vector185:
  pushl $0
c0102ec8:	6a 00                	push   $0x0
  pushl $185
c0102eca:	68 b9 00 00 00       	push   $0xb9
  jmp __alltraps
c0102ecf:	e9 48 03 00 00       	jmp    c010321c <__alltraps>

c0102ed4 <vector186>:
.globl vector186
vector186:
  pushl $0
c0102ed4:	6a 00                	push   $0x0
  pushl $186
c0102ed6:	68 ba 00 00 00       	push   $0xba
  jmp __alltraps
c0102edb:	e9 3c 03 00 00       	jmp    c010321c <__alltraps>

c0102ee0 <vector187>:
.globl vector187
vector187:
  pushl $0
c0102ee0:	6a 00                	push   $0x0
  pushl $187
c0102ee2:	68 bb 00 00 00       	push   $0xbb
  jmp __alltraps
c0102ee7:	e9 30 03 00 00       	jmp    c010321c <__alltraps>

c0102eec <vector188>:
.globl vector188
vector188:
  pushl $0
c0102eec:	6a 00                	push   $0x0
  pushl $188
c0102eee:	68 bc 00 00 00       	push   $0xbc
  jmp __alltraps
c0102ef3:	e9 24 03 00 00       	jmp    c010321c <__alltraps>

c0102ef8 <vector189>:
.globl vector189
vector189:
  pushl $0
c0102ef8:	6a 00                	push   $0x0
  pushl $189
c0102efa:	68 bd 00 00 00       	push   $0xbd
  jmp __alltraps
c0102eff:	e9 18 03 00 00       	jmp    c010321c <__alltraps>

c0102f04 <vector190>:
.globl vector190
vector190:
  pushl $0
c0102f04:	6a 00                	push   $0x0
  pushl $190
c0102f06:	68 be 00 00 00       	push   $0xbe
  jmp __alltraps
c0102f0b:	e9 0c 03 00 00       	jmp    c010321c <__alltraps>

c0102f10 <vector191>:
.globl vector191
vector191:
  pushl $0
c0102f10:	6a 00                	push   $0x0
  pushl $191
c0102f12:	68 bf 00 00 00       	push   $0xbf
  jmp __alltraps
c0102f17:	e9 00 03 00 00       	jmp    c010321c <__alltraps>

c0102f1c <vector192>:
.globl vector192
vector192:
  pushl $0
c0102f1c:	6a 00                	push   $0x0
  pushl $192
c0102f1e:	68 c0 00 00 00       	push   $0xc0
  jmp __alltraps
c0102f23:	e9 f4 02 00 00       	jmp    c010321c <__alltraps>

c0102f28 <vector193>:
.globl vector193
vector193:
  pushl $0
c0102f28:	6a 00                	push   $0x0
  pushl $193
c0102f2a:	68 c1 00 00 00       	push   $0xc1
  jmp __alltraps
c0102f2f:	e9 e8 02 00 00       	jmp    c010321c <__alltraps>

c0102f34 <vector194>:
.globl vector194
vector194:
  pushl $0
c0102f34:	6a 00                	push   $0x0
  pushl $194
c0102f36:	68 c2 00 00 00       	push   $0xc2
  jmp __alltraps
c0102f3b:	e9 dc 02 00 00       	jmp    c010321c <__alltraps>

c0102f40 <vector195>:
.globl vector195
vector195:
  pushl $0
c0102f40:	6a 00                	push   $0x0
  pushl $195
c0102f42:	68 c3 00 00 00       	push   $0xc3
  jmp __alltraps
c0102f47:	e9 d0 02 00 00       	jmp    c010321c <__alltraps>

c0102f4c <vector196>:
.globl vector196
vector196:
  pushl $0
c0102f4c:	6a 00                	push   $0x0
  pushl $196
c0102f4e:	68 c4 00 00 00       	push   $0xc4
  jmp __alltraps
c0102f53:	e9 c4 02 00 00       	jmp    c010321c <__alltraps>

c0102f58 <vector197>:
.globl vector197
vector197:
  pushl $0
c0102f58:	6a 00                	push   $0x0
  pushl $197
c0102f5a:	68 c5 00 00 00       	push   $0xc5
  jmp __alltraps
c0102f5f:	e9 b8 02 00 00       	jmp    c010321c <__alltraps>

c0102f64 <vector198>:
.globl vector198
vector198:
  pushl $0
c0102f64:	6a 00                	push   $0x0
  pushl $198
c0102f66:	68 c6 00 00 00       	push   $0xc6
  jmp __alltraps
c0102f6b:	e9 ac 02 00 00       	jmp    c010321c <__alltraps>

c0102f70 <vector199>:
.globl vector199
vector199:
  pushl $0
c0102f70:	6a 00                	push   $0x0
  pushl $199
c0102f72:	68 c7 00 00 00       	push   $0xc7
  jmp __alltraps
c0102f77:	e9 a0 02 00 00       	jmp    c010321c <__alltraps>

c0102f7c <vector200>:
.globl vector200
vector200:
  pushl $0
c0102f7c:	6a 00                	push   $0x0
  pushl $200
c0102f7e:	68 c8 00 00 00       	push   $0xc8
  jmp __alltraps
c0102f83:	e9 94 02 00 00       	jmp    c010321c <__alltraps>

c0102f88 <vector201>:
.globl vector201
vector201:
  pushl $0
c0102f88:	6a 00                	push   $0x0
  pushl $201
c0102f8a:	68 c9 00 00 00       	push   $0xc9
  jmp __alltraps
c0102f8f:	e9 88 02 00 00       	jmp    c010321c <__alltraps>

c0102f94 <vector202>:
.globl vector202
vector202:
  pushl $0
c0102f94:	6a 00                	push   $0x0
  pushl $202
c0102f96:	68 ca 00 00 00       	push   $0xca
  jmp __alltraps
c0102f9b:	e9 7c 02 00 00       	jmp    c010321c <__alltraps>

c0102fa0 <vector203>:
.globl vector203
vector203:
  pushl $0
c0102fa0:	6a 00                	push   $0x0
  pushl $203
c0102fa2:	68 cb 00 00 00       	push   $0xcb
  jmp __alltraps
c0102fa7:	e9 70 02 00 00       	jmp    c010321c <__alltraps>

c0102fac <vector204>:
.globl vector204
vector204:
  pushl $0
c0102fac:	6a 00                	push   $0x0
  pushl $204
c0102fae:	68 cc 00 00 00       	push   $0xcc
  jmp __alltraps
c0102fb3:	e9 64 02 00 00       	jmp    c010321c <__alltraps>

c0102fb8 <vector205>:
.globl vector205
vector205:
  pushl $0
c0102fb8:	6a 00                	push   $0x0
  pushl $205
c0102fba:	68 cd 00 00 00       	push   $0xcd
  jmp __alltraps
c0102fbf:	e9 58 02 00 00       	jmp    c010321c <__alltraps>

c0102fc4 <vector206>:
.globl vector206
vector206:
  pushl $0
c0102fc4:	6a 00                	push   $0x0
  pushl $206
c0102fc6:	68 ce 00 00 00       	push   $0xce
  jmp __alltraps
c0102fcb:	e9 4c 02 00 00       	jmp    c010321c <__alltraps>

c0102fd0 <vector207>:
.globl vector207
vector207:
  pushl $0
c0102fd0:	6a 00                	push   $0x0
  pushl $207
c0102fd2:	68 cf 00 00 00       	push   $0xcf
  jmp __alltraps
c0102fd7:	e9 40 02 00 00       	jmp    c010321c <__alltraps>

c0102fdc <vector208>:
.globl vector208
vector208:
  pushl $0
c0102fdc:	6a 00                	push   $0x0
  pushl $208
c0102fde:	68 d0 00 00 00       	push   $0xd0
  jmp __alltraps
c0102fe3:	e9 34 02 00 00       	jmp    c010321c <__alltraps>

c0102fe8 <vector209>:
.globl vector209
vector209:
  pushl $0
c0102fe8:	6a 00                	push   $0x0
  pushl $209
c0102fea:	68 d1 00 00 00       	push   $0xd1
  jmp __alltraps
c0102fef:	e9 28 02 00 00       	jmp    c010321c <__alltraps>

c0102ff4 <vector210>:
.globl vector210
vector210:
  pushl $0
c0102ff4:	6a 00                	push   $0x0
  pushl $210
c0102ff6:	68 d2 00 00 00       	push   $0xd2
  jmp __alltraps
c0102ffb:	e9 1c 02 00 00       	jmp    c010321c <__alltraps>

c0103000 <vector211>:
.globl vector211
vector211:
  pushl $0
c0103000:	6a 00                	push   $0x0
  pushl $211
c0103002:	68 d3 00 00 00       	push   $0xd3
  jmp __alltraps
c0103007:	e9 10 02 00 00       	jmp    c010321c <__alltraps>

c010300c <vector212>:
.globl vector212
vector212:
  pushl $0
c010300c:	6a 00                	push   $0x0
  pushl $212
c010300e:	68 d4 00 00 00       	push   $0xd4
  jmp __alltraps
c0103013:	e9 04 02 00 00       	jmp    c010321c <__alltraps>

c0103018 <vector213>:
.globl vector213
vector213:
  pushl $0
c0103018:	6a 00                	push   $0x0
  pushl $213
c010301a:	68 d5 00 00 00       	push   $0xd5
  jmp __alltraps
c010301f:	e9 f8 01 00 00       	jmp    c010321c <__alltraps>

c0103024 <vector214>:
.globl vector214
vector214:
  pushl $0
c0103024:	6a 00                	push   $0x0
  pushl $214
c0103026:	68 d6 00 00 00       	push   $0xd6
  jmp __alltraps
c010302b:	e9 ec 01 00 00       	jmp    c010321c <__alltraps>

c0103030 <vector215>:
.globl vector215
vector215:
  pushl $0
c0103030:	6a 00                	push   $0x0
  pushl $215
c0103032:	68 d7 00 00 00       	push   $0xd7
  jmp __alltraps
c0103037:	e9 e0 01 00 00       	jmp    c010321c <__alltraps>

c010303c <vector216>:
.globl vector216
vector216:
  pushl $0
c010303c:	6a 00                	push   $0x0
  pushl $216
c010303e:	68 d8 00 00 00       	push   $0xd8
  jmp __alltraps
c0103043:	e9 d4 01 00 00       	jmp    c010321c <__alltraps>

c0103048 <vector217>:
.globl vector217
vector217:
  pushl $0
c0103048:	6a 00                	push   $0x0
  pushl $217
c010304a:	68 d9 00 00 00       	push   $0xd9
  jmp __alltraps
c010304f:	e9 c8 01 00 00       	jmp    c010321c <__alltraps>

c0103054 <vector218>:
.globl vector218
vector218:
  pushl $0
c0103054:	6a 00                	push   $0x0
  pushl $218
c0103056:	68 da 00 00 00       	push   $0xda
  jmp __alltraps
c010305b:	e9 bc 01 00 00       	jmp    c010321c <__alltraps>

c0103060 <vector219>:
.globl vector219
vector219:
  pushl $0
c0103060:	6a 00                	push   $0x0
  pushl $219
c0103062:	68 db 00 00 00       	push   $0xdb
  jmp __alltraps
c0103067:	e9 b0 01 00 00       	jmp    c010321c <__alltraps>

c010306c <vector220>:
.globl vector220
vector220:
  pushl $0
c010306c:	6a 00                	push   $0x0
  pushl $220
c010306e:	68 dc 00 00 00       	push   $0xdc
  jmp __alltraps
c0103073:	e9 a4 01 00 00       	jmp    c010321c <__alltraps>

c0103078 <vector221>:
.globl vector221
vector221:
  pushl $0
c0103078:	6a 00                	push   $0x0
  pushl $221
c010307a:	68 dd 00 00 00       	push   $0xdd
  jmp __alltraps
c010307f:	e9 98 01 00 00       	jmp    c010321c <__alltraps>

c0103084 <vector222>:
.globl vector222
vector222:
  pushl $0
c0103084:	6a 00                	push   $0x0
  pushl $222
c0103086:	68 de 00 00 00       	push   $0xde
  jmp __alltraps
c010308b:	e9 8c 01 00 00       	jmp    c010321c <__alltraps>

c0103090 <vector223>:
.globl vector223
vector223:
  pushl $0
c0103090:	6a 00                	push   $0x0
  pushl $223
c0103092:	68 df 00 00 00       	push   $0xdf
  jmp __alltraps
c0103097:	e9 80 01 00 00       	jmp    c010321c <__alltraps>

c010309c <vector224>:
.globl vector224
vector224:
  pushl $0
c010309c:	6a 00                	push   $0x0
  pushl $224
c010309e:	68 e0 00 00 00       	push   $0xe0
  jmp __alltraps
c01030a3:	e9 74 01 00 00       	jmp    c010321c <__alltraps>

c01030a8 <vector225>:
.globl vector225
vector225:
  pushl $0
c01030a8:	6a 00                	push   $0x0
  pushl $225
c01030aa:	68 e1 00 00 00       	push   $0xe1
  jmp __alltraps
c01030af:	e9 68 01 00 00       	jmp    c010321c <__alltraps>

c01030b4 <vector226>:
.globl vector226
vector226:
  pushl $0
c01030b4:	6a 00                	push   $0x0
  pushl $226
c01030b6:	68 e2 00 00 00       	push   $0xe2
  jmp __alltraps
c01030bb:	e9 5c 01 00 00       	jmp    c010321c <__alltraps>

c01030c0 <vector227>:
.globl vector227
vector227:
  pushl $0
c01030c0:	6a 00                	push   $0x0
  pushl $227
c01030c2:	68 e3 00 00 00       	push   $0xe3
  jmp __alltraps
c01030c7:	e9 50 01 00 00       	jmp    c010321c <__alltraps>

c01030cc <vector228>:
.globl vector228
vector228:
  pushl $0
c01030cc:	6a 00                	push   $0x0
  pushl $228
c01030ce:	68 e4 00 00 00       	push   $0xe4
  jmp __alltraps
c01030d3:	e9 44 01 00 00       	jmp    c010321c <__alltraps>

c01030d8 <vector229>:
.globl vector229
vector229:
  pushl $0
c01030d8:	6a 00                	push   $0x0
  pushl $229
c01030da:	68 e5 00 00 00       	push   $0xe5
  jmp __alltraps
c01030df:	e9 38 01 00 00       	jmp    c010321c <__alltraps>

c01030e4 <vector230>:
.globl vector230
vector230:
  pushl $0
c01030e4:	6a 00                	push   $0x0
  pushl $230
c01030e6:	68 e6 00 00 00       	push   $0xe6
  jmp __alltraps
c01030eb:	e9 2c 01 00 00       	jmp    c010321c <__alltraps>

c01030f0 <vector231>:
.globl vector231
vector231:
  pushl $0
c01030f0:	6a 00                	push   $0x0
  pushl $231
c01030f2:	68 e7 00 00 00       	push   $0xe7
  jmp __alltraps
c01030f7:	e9 20 01 00 00       	jmp    c010321c <__alltraps>

c01030fc <vector232>:
.globl vector232
vector232:
  pushl $0
c01030fc:	6a 00                	push   $0x0
  pushl $232
c01030fe:	68 e8 00 00 00       	push   $0xe8
  jmp __alltraps
c0103103:	e9 14 01 00 00       	jmp    c010321c <__alltraps>

c0103108 <vector233>:
.globl vector233
vector233:
  pushl $0
c0103108:	6a 00                	push   $0x0
  pushl $233
c010310a:	68 e9 00 00 00       	push   $0xe9
  jmp __alltraps
c010310f:	e9 08 01 00 00       	jmp    c010321c <__alltraps>

c0103114 <vector234>:
.globl vector234
vector234:
  pushl $0
c0103114:	6a 00                	push   $0x0
  pushl $234
c0103116:	68 ea 00 00 00       	push   $0xea
  jmp __alltraps
c010311b:	e9 fc 00 00 00       	jmp    c010321c <__alltraps>

c0103120 <vector235>:
.globl vector235
vector235:
  pushl $0
c0103120:	6a 00                	push   $0x0
  pushl $235
c0103122:	68 eb 00 00 00       	push   $0xeb
  jmp __alltraps
c0103127:	e9 f0 00 00 00       	jmp    c010321c <__alltraps>

c010312c <vector236>:
.globl vector236
vector236:
  pushl $0
c010312c:	6a 00                	push   $0x0
  pushl $236
c010312e:	68 ec 00 00 00       	push   $0xec
  jmp __alltraps
c0103133:	e9 e4 00 00 00       	jmp    c010321c <__alltraps>

c0103138 <vector237>:
.globl vector237
vector237:
  pushl $0
c0103138:	6a 00                	push   $0x0
  pushl $237
c010313a:	68 ed 00 00 00       	push   $0xed
  jmp __alltraps
c010313f:	e9 d8 00 00 00       	jmp    c010321c <__alltraps>

c0103144 <vector238>:
.globl vector238
vector238:
  pushl $0
c0103144:	6a 00                	push   $0x0
  pushl $238
c0103146:	68 ee 00 00 00       	push   $0xee
  jmp __alltraps
c010314b:	e9 cc 00 00 00       	jmp    c010321c <__alltraps>

c0103150 <vector239>:
.globl vector239
vector239:
  pushl $0
c0103150:	6a 00                	push   $0x0
  pushl $239
c0103152:	68 ef 00 00 00       	push   $0xef
  jmp __alltraps
c0103157:	e9 c0 00 00 00       	jmp    c010321c <__alltraps>

c010315c <vector240>:
.globl vector240
vector240:
  pushl $0
c010315c:	6a 00                	push   $0x0
  pushl $240
c010315e:	68 f0 00 00 00       	push   $0xf0
  jmp __alltraps
c0103163:	e9 b4 00 00 00       	jmp    c010321c <__alltraps>

c0103168 <vector241>:
.globl vector241
vector241:
  pushl $0
c0103168:	6a 00                	push   $0x0
  pushl $241
c010316a:	68 f1 00 00 00       	push   $0xf1
  jmp __alltraps
c010316f:	e9 a8 00 00 00       	jmp    c010321c <__alltraps>

c0103174 <vector242>:
.globl vector242
vector242:
  pushl $0
c0103174:	6a 00                	push   $0x0
  pushl $242
c0103176:	68 f2 00 00 00       	push   $0xf2
  jmp __alltraps
c010317b:	e9 9c 00 00 00       	jmp    c010321c <__alltraps>

c0103180 <vector243>:
.globl vector243
vector243:
  pushl $0
c0103180:	6a 00                	push   $0x0
  pushl $243
c0103182:	68 f3 00 00 00       	push   $0xf3
  jmp __alltraps
c0103187:	e9 90 00 00 00       	jmp    c010321c <__alltraps>

c010318c <vector244>:
.globl vector244
vector244:
  pushl $0
c010318c:	6a 00                	push   $0x0
  pushl $244
c010318e:	68 f4 00 00 00       	push   $0xf4
  jmp __alltraps
c0103193:	e9 84 00 00 00       	jmp    c010321c <__alltraps>

c0103198 <vector245>:
.globl vector245
vector245:
  pushl $0
c0103198:	6a 00                	push   $0x0
  pushl $245
c010319a:	68 f5 00 00 00       	push   $0xf5
  jmp __alltraps
c010319f:	e9 78 00 00 00       	jmp    c010321c <__alltraps>

c01031a4 <vector246>:
.globl vector246
vector246:
  pushl $0
c01031a4:	6a 00                	push   $0x0
  pushl $246
c01031a6:	68 f6 00 00 00       	push   $0xf6
  jmp __alltraps
c01031ab:	e9 6c 00 00 00       	jmp    c010321c <__alltraps>

c01031b0 <vector247>:
.globl vector247
vector247:
  pushl $0
c01031b0:	6a 00                	push   $0x0
  pushl $247
c01031b2:	68 f7 00 00 00       	push   $0xf7
  jmp __alltraps
c01031b7:	e9 60 00 00 00       	jmp    c010321c <__alltraps>

c01031bc <vector248>:
.globl vector248
vector248:
  pushl $0
c01031bc:	6a 00                	push   $0x0
  pushl $248
c01031be:	68 f8 00 00 00       	push   $0xf8
  jmp __alltraps
c01031c3:	e9 54 00 00 00       	jmp    c010321c <__alltraps>

c01031c8 <vector249>:
.globl vector249
vector249:
  pushl $0
c01031c8:	6a 00                	push   $0x0
  pushl $249
c01031ca:	68 f9 00 00 00       	push   $0xf9
  jmp __alltraps
c01031cf:	e9 48 00 00 00       	jmp    c010321c <__alltraps>

c01031d4 <vector250>:
.globl vector250
vector250:
  pushl $0
c01031d4:	6a 00                	push   $0x0
  pushl $250
c01031d6:	68 fa 00 00 00       	push   $0xfa
  jmp __alltraps
c01031db:	e9 3c 00 00 00       	jmp    c010321c <__alltraps>

c01031e0 <vector251>:
.globl vector251
vector251:
  pushl $0
c01031e0:	6a 00                	push   $0x0
  pushl $251
c01031e2:	68 fb 00 00 00       	push   $0xfb
  jmp __alltraps
c01031e7:	e9 30 00 00 00       	jmp    c010321c <__alltraps>

c01031ec <vector252>:
.globl vector252
vector252:
  pushl $0
c01031ec:	6a 00                	push   $0x0
  pushl $252
c01031ee:	68 fc 00 00 00       	push   $0xfc
  jmp __alltraps
c01031f3:	e9 24 00 00 00       	jmp    c010321c <__alltraps>

c01031f8 <vector253>:
.globl vector253
vector253:
  pushl $0
c01031f8:	6a 00                	push   $0x0
  pushl $253
c01031fa:	68 fd 00 00 00       	push   $0xfd
  jmp __alltraps
c01031ff:	e9 18 00 00 00       	jmp    c010321c <__alltraps>

c0103204 <vector254>:
.globl vector254
vector254:
  pushl $0
c0103204:	6a 00                	push   $0x0
  pushl $254
c0103206:	68 fe 00 00 00       	push   $0xfe
  jmp __alltraps
c010320b:	e9 0c 00 00 00       	jmp    c010321c <__alltraps>

c0103210 <vector255>:
.globl vector255
vector255:
  pushl $0
c0103210:	6a 00                	push   $0x0
  pushl $255
c0103212:	68 ff 00 00 00       	push   $0xff
  jmp __alltraps
c0103217:	e9 00 00 00 00       	jmp    c010321c <__alltraps>

c010321c <__alltraps>:
.text
.globl __alltraps
__alltraps:
    # push registers to build a trap frame
    # therefore make the stack look like a struct trapframe
    pushl %ds
c010321c:	1e                   	push   %ds
    pushl %es
c010321d:	06                   	push   %es
    pushl %fs
c010321e:	0f a0                	push   %fs
    pushl %gs
c0103220:	0f a8                	push   %gs
    pushal
c0103222:	60                   	pusha  

    # load GD_KDATA into %ds and %es to set up data segments for kernel
    movl $GD_KDATA, %eax
c0103223:	b8 10 00 00 00       	mov    $0x10,%eax
    movw %ax, %ds
c0103228:	8e d8                	mov    %eax,%ds
    movw %ax, %es
c010322a:	8e c0                	mov    %eax,%es

    # push %esp to pass a pointer to the trapframe as an argument to trap()
    pushl %esp
c010322c:	54                   	push   %esp

    # call trap(tf), where tf=%esp
    call trap
c010322d:	e8 5f f5 ff ff       	call   c0102791 <trap>

    # pop the pushed stack pointer
    popl %esp
c0103232:	5c                   	pop    %esp

c0103233 <__trapret>:

    # return falls through to trapret...
.globl __trapret
__trapret:
    # restore registers from stack
    popal
c0103233:	61                   	popa   

    # restore %ds, %es, %fs and %gs
    popl %gs
c0103234:	0f a9                	pop    %gs
    popl %fs
c0103236:	0f a1                	pop    %fs
    popl %es
c0103238:	07                   	pop    %es
    popl %ds
c0103239:	1f                   	pop    %ds

    # get rid of the trap number and error code
    addl $0x8, %esp
c010323a:	83 c4 08             	add    $0x8,%esp
    iret
c010323d:	cf                   	iret   

c010323e <pa2page>:
page2pa(struct Page *page) {
    return page2ppn(page) << PGSHIFT;
}

static inline struct Page *
pa2page(uintptr_t pa) {
c010323e:	55                   	push   %ebp
c010323f:	89 e5                	mov    %esp,%ebp
c0103241:	83 ec 08             	sub    $0x8,%esp
    if (PPN(pa) >= npage) {
c0103244:	8b 45 08             	mov    0x8(%ebp),%eax
c0103247:	c1 e8 0c             	shr    $0xc,%eax
c010324a:	89 c2                	mov    %eax,%edx
c010324c:	a1 80 5f 12 c0       	mov    0xc0125f80,%eax
c0103251:	39 c2                	cmp    %eax,%edx
c0103253:	72 14                	jb     c0103269 <pa2page+0x2b>
        panic("pa2page called with invalid pa");
c0103255:	83 ec 04             	sub    $0x4,%esp
c0103258:	68 90 8d 10 c0       	push   $0xc0108d90
c010325d:	6a 5b                	push   $0x5b
c010325f:	68 af 8d 10 c0       	push   $0xc0108daf
c0103264:	e8 bc d1 ff ff       	call   c0100425 <__panic>
    }
    return &pages[PPN(pa)];
c0103269:	a1 f8 60 12 c0       	mov    0xc01260f8,%eax
c010326e:	8b 55 08             	mov    0x8(%ebp),%edx
c0103271:	c1 ea 0c             	shr    $0xc,%edx
c0103274:	c1 e2 05             	shl    $0x5,%edx
c0103277:	01 d0                	add    %edx,%eax
}
c0103279:	c9                   	leave  
c010327a:	c3                   	ret    

c010327b <pde2page>:
    }
    return pa2page(PTE_ADDR(pte));
}

static inline struct Page *
pde2page(pde_t pde) {
c010327b:	55                   	push   %ebp
c010327c:	89 e5                	mov    %esp,%ebp
c010327e:	83 ec 08             	sub    $0x8,%esp
    return pa2page(PDE_ADDR(pde));
c0103281:	8b 45 08             	mov    0x8(%ebp),%eax
c0103284:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0103289:	83 ec 0c             	sub    $0xc,%esp
c010328c:	50                   	push   %eax
c010328d:	e8 ac ff ff ff       	call   c010323e <pa2page>
c0103292:	83 c4 10             	add    $0x10,%esp
}
c0103295:	c9                   	leave  
c0103296:	c3                   	ret    

c0103297 <mm_create>:
static void check_vma_struct(void);
static void check_pgfault(void);

// mm_create -  alloc a mm_struct & initialize it.
struct mm_struct *
mm_create(void) {
c0103297:	f3 0f 1e fb          	endbr32 
c010329b:	55                   	push   %ebp
c010329c:	89 e5                	mov    %esp,%ebp
c010329e:	83 ec 18             	sub    $0x18,%esp
    struct mm_struct *mm = kmalloc(sizeof(struct mm_struct));
c01032a1:	83 ec 0c             	sub    $0xc,%esp
c01032a4:	6a 18                	push   $0x18
c01032a6:	e8 47 43 00 00       	call   c01075f2 <kmalloc>
c01032ab:	83 c4 10             	add    $0x10,%esp
c01032ae:	89 45 f4             	mov    %eax,-0xc(%ebp)

    if (mm != NULL) {
c01032b1:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01032b5:	74 5c                	je     c0103313 <mm_create+0x7c>
        list_init(&(mm->mmap_list));
c01032b7:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01032ba:	89 45 f0             	mov    %eax,-0x10(%ebp)
 * list_init - initialize a new entry
 * @elm:        new entry to be initialized
 * */
static inline void
list_init(list_entry_t *elm) {
    elm->prev = elm->next = elm;
c01032bd:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01032c0:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01032c3:	89 50 04             	mov    %edx,0x4(%eax)
c01032c6:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01032c9:	8b 50 04             	mov    0x4(%eax),%edx
c01032cc:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01032cf:	89 10                	mov    %edx,(%eax)
}
c01032d1:	90                   	nop
        mm->mmap_cache = NULL;
c01032d2:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01032d5:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
        mm->pgdir = NULL;
c01032dc:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01032df:	c7 40 0c 00 00 00 00 	movl   $0x0,0xc(%eax)
        mm->map_count = 0;
c01032e6:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01032e9:	c7 40 10 00 00 00 00 	movl   $0x0,0x10(%eax)

        if (swap_init_ok) swap_init_mm(mm);
c01032f0:	a1 68 5f 12 c0       	mov    0xc0125f68,%eax
c01032f5:	85 c0                	test   %eax,%eax
c01032f7:	74 10                	je     c0103309 <mm_create+0x72>
c01032f9:	83 ec 0c             	sub    $0xc,%esp
c01032fc:	ff 75 f4             	pushl  -0xc(%ebp)
c01032ff:	e8 5f 11 00 00       	call   c0104463 <swap_init_mm>
c0103304:	83 c4 10             	add    $0x10,%esp
c0103307:	eb 0a                	jmp    c0103313 <mm_create+0x7c>
        else mm->sm_priv = NULL;
c0103309:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010330c:	c7 40 14 00 00 00 00 	movl   $0x0,0x14(%eax)
    }
    return mm;
c0103313:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0103316:	c9                   	leave  
c0103317:	c3                   	ret    

c0103318 <vma_create>:

// vma_create - alloc a vma_struct & initialize it. (addr range: vm_start~vm_end)
struct vma_struct *
vma_create(uintptr_t vm_start, uintptr_t vm_end, uint32_t vm_flags) {
c0103318:	f3 0f 1e fb          	endbr32 
c010331c:	55                   	push   %ebp
c010331d:	89 e5                	mov    %esp,%ebp
c010331f:	83 ec 18             	sub    $0x18,%esp
    struct vma_struct *vma = kmalloc(sizeof(struct vma_struct));
c0103322:	83 ec 0c             	sub    $0xc,%esp
c0103325:	6a 18                	push   $0x18
c0103327:	e8 c6 42 00 00       	call   c01075f2 <kmalloc>
c010332c:	83 c4 10             	add    $0x10,%esp
c010332f:	89 45 f4             	mov    %eax,-0xc(%ebp)

    if (vma != NULL) {
c0103332:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0103336:	74 1b                	je     c0103353 <vma_create+0x3b>
        vma->vm_start = vm_start;
c0103338:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010333b:	8b 55 08             	mov    0x8(%ebp),%edx
c010333e:	89 50 04             	mov    %edx,0x4(%eax)
        vma->vm_end = vm_end;
c0103341:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103344:	8b 55 0c             	mov    0xc(%ebp),%edx
c0103347:	89 50 08             	mov    %edx,0x8(%eax)
        vma->vm_flags = vm_flags;
c010334a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010334d:	8b 55 10             	mov    0x10(%ebp),%edx
c0103350:	89 50 0c             	mov    %edx,0xc(%eax)
    }
    return vma;
c0103353:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0103356:	c9                   	leave  
c0103357:	c3                   	ret    

c0103358 <find_vma>:


// find_vma - find a vma  (vma->vm_start <= addr <= vma_vm_end)
struct vma_struct *
find_vma(struct mm_struct *mm, uintptr_t addr) {
c0103358:	f3 0f 1e fb          	endbr32 
c010335c:	55                   	push   %ebp
c010335d:	89 e5                	mov    %esp,%ebp
c010335f:	83 ec 20             	sub    $0x20,%esp
    struct vma_struct *vma = NULL;
c0103362:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    if (mm != NULL) {
c0103369:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c010336d:	0f 84 95 00 00 00    	je     c0103408 <find_vma+0xb0>
        vma = mm->mmap_cache;
c0103373:	8b 45 08             	mov    0x8(%ebp),%eax
c0103376:	8b 40 08             	mov    0x8(%eax),%eax
c0103379:	89 45 fc             	mov    %eax,-0x4(%ebp)
        if (!(vma != NULL && vma->vm_start <= addr && vma->vm_end > addr)) {
c010337c:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
c0103380:	74 16                	je     c0103398 <find_vma+0x40>
c0103382:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0103385:	8b 40 04             	mov    0x4(%eax),%eax
c0103388:	39 45 0c             	cmp    %eax,0xc(%ebp)
c010338b:	72 0b                	jb     c0103398 <find_vma+0x40>
c010338d:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0103390:	8b 40 08             	mov    0x8(%eax),%eax
c0103393:	39 45 0c             	cmp    %eax,0xc(%ebp)
c0103396:	72 61                	jb     c01033f9 <find_vma+0xa1>
                bool found = 0;
c0103398:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)
                list_entry_t *list = &(mm->mmap_list), *le = list;
c010339f:	8b 45 08             	mov    0x8(%ebp),%eax
c01033a2:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01033a5:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01033a8:	89 45 f4             	mov    %eax,-0xc(%ebp)
                while ((le = list_next(le)) != list) {
c01033ab:	eb 28                	jmp    c01033d5 <find_vma+0x7d>
                    vma = le2vma(le, list_link);
c01033ad:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01033b0:	83 e8 10             	sub    $0x10,%eax
c01033b3:	89 45 fc             	mov    %eax,-0x4(%ebp)
                    if (vma->vm_start<=addr && addr < vma->vm_end) {
c01033b6:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01033b9:	8b 40 04             	mov    0x4(%eax),%eax
c01033bc:	39 45 0c             	cmp    %eax,0xc(%ebp)
c01033bf:	72 14                	jb     c01033d5 <find_vma+0x7d>
c01033c1:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01033c4:	8b 40 08             	mov    0x8(%eax),%eax
c01033c7:	39 45 0c             	cmp    %eax,0xc(%ebp)
c01033ca:	73 09                	jae    c01033d5 <find_vma+0x7d>
                        found = 1;
c01033cc:	c7 45 f8 01 00 00 00 	movl   $0x1,-0x8(%ebp)
                        break;
c01033d3:	eb 17                	jmp    c01033ec <find_vma+0x94>
c01033d5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01033d8:	89 45 ec             	mov    %eax,-0x14(%ebp)
 * list_next - get the next entry
 * @listelm:    the list head
 **/
static inline list_entry_t *
list_next(list_entry_t *listelm) {
    return listelm->next;
c01033db:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01033de:	8b 40 04             	mov    0x4(%eax),%eax
                while ((le = list_next(le)) != list) {
c01033e1:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01033e4:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01033e7:	3b 45 f0             	cmp    -0x10(%ebp),%eax
c01033ea:	75 c1                	jne    c01033ad <find_vma+0x55>
                    }
                }
                if (!found) {
c01033ec:	83 7d f8 00          	cmpl   $0x0,-0x8(%ebp)
c01033f0:	75 07                	jne    c01033f9 <find_vma+0xa1>
                    vma = NULL;
c01033f2:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
                }
        }
        if (vma != NULL) {
c01033f9:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
c01033fd:	74 09                	je     c0103408 <find_vma+0xb0>
            mm->mmap_cache = vma;
c01033ff:	8b 45 08             	mov    0x8(%ebp),%eax
c0103402:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0103405:	89 50 08             	mov    %edx,0x8(%eax)
        }
    }
    return vma;
c0103408:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c010340b:	c9                   	leave  
c010340c:	c3                   	ret    

c010340d <check_vma_overlap>:


// check_vma_overlap - check if vma1 overlaps vma2 ?
static inline void
check_vma_overlap(struct vma_struct *prev, struct vma_struct *next) {
c010340d:	55                   	push   %ebp
c010340e:	89 e5                	mov    %esp,%ebp
c0103410:	83 ec 08             	sub    $0x8,%esp
    assert(prev->vm_start < prev->vm_end);
c0103413:	8b 45 08             	mov    0x8(%ebp),%eax
c0103416:	8b 50 04             	mov    0x4(%eax),%edx
c0103419:	8b 45 08             	mov    0x8(%ebp),%eax
c010341c:	8b 40 08             	mov    0x8(%eax),%eax
c010341f:	39 c2                	cmp    %eax,%edx
c0103421:	72 16                	jb     c0103439 <check_vma_overlap+0x2c>
c0103423:	68 bd 8d 10 c0       	push   $0xc0108dbd
c0103428:	68 db 8d 10 c0       	push   $0xc0108ddb
c010342d:	6a 67                	push   $0x67
c010342f:	68 f0 8d 10 c0       	push   $0xc0108df0
c0103434:	e8 ec cf ff ff       	call   c0100425 <__panic>
    assert(prev->vm_end <= next->vm_start);
c0103439:	8b 45 08             	mov    0x8(%ebp),%eax
c010343c:	8b 50 08             	mov    0x8(%eax),%edx
c010343f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103442:	8b 40 04             	mov    0x4(%eax),%eax
c0103445:	39 c2                	cmp    %eax,%edx
c0103447:	76 16                	jbe    c010345f <check_vma_overlap+0x52>
c0103449:	68 00 8e 10 c0       	push   $0xc0108e00
c010344e:	68 db 8d 10 c0       	push   $0xc0108ddb
c0103453:	6a 68                	push   $0x68
c0103455:	68 f0 8d 10 c0       	push   $0xc0108df0
c010345a:	e8 c6 cf ff ff       	call   c0100425 <__panic>
    assert(next->vm_start < next->vm_end);
c010345f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103462:	8b 50 04             	mov    0x4(%eax),%edx
c0103465:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103468:	8b 40 08             	mov    0x8(%eax),%eax
c010346b:	39 c2                	cmp    %eax,%edx
c010346d:	72 16                	jb     c0103485 <check_vma_overlap+0x78>
c010346f:	68 1f 8e 10 c0       	push   $0xc0108e1f
c0103474:	68 db 8d 10 c0       	push   $0xc0108ddb
c0103479:	6a 69                	push   $0x69
c010347b:	68 f0 8d 10 c0       	push   $0xc0108df0
c0103480:	e8 a0 cf ff ff       	call   c0100425 <__panic>
}
c0103485:	90                   	nop
c0103486:	c9                   	leave  
c0103487:	c3                   	ret    

c0103488 <insert_vma_struct>:


// insert_vma_struct -insert vma in mm's list link
void
insert_vma_struct(struct mm_struct *mm, struct vma_struct *vma) {
c0103488:	f3 0f 1e fb          	endbr32 
c010348c:	55                   	push   %ebp
c010348d:	89 e5                	mov    %esp,%ebp
c010348f:	83 ec 38             	sub    $0x38,%esp
    assert(vma->vm_start < vma->vm_end);
c0103492:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103495:	8b 50 04             	mov    0x4(%eax),%edx
c0103498:	8b 45 0c             	mov    0xc(%ebp),%eax
c010349b:	8b 40 08             	mov    0x8(%eax),%eax
c010349e:	39 c2                	cmp    %eax,%edx
c01034a0:	72 16                	jb     c01034b8 <insert_vma_struct+0x30>
c01034a2:	68 3d 8e 10 c0       	push   $0xc0108e3d
c01034a7:	68 db 8d 10 c0       	push   $0xc0108ddb
c01034ac:	6a 70                	push   $0x70
c01034ae:	68 f0 8d 10 c0       	push   $0xc0108df0
c01034b3:	e8 6d cf ff ff       	call   c0100425 <__panic>
    list_entry_t *list = &(mm->mmap_list);
c01034b8:	8b 45 08             	mov    0x8(%ebp),%eax
c01034bb:	89 45 ec             	mov    %eax,-0x14(%ebp)
    list_entry_t *le_prev = list, *le_next;
c01034be:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01034c1:	89 45 f4             	mov    %eax,-0xc(%ebp)

        list_entry_t *le = list;
c01034c4:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01034c7:	89 45 f0             	mov    %eax,-0x10(%ebp)
        while ((le = list_next(le)) != list) {
c01034ca:	eb 1f                	jmp    c01034eb <insert_vma_struct+0x63>
            struct vma_struct *mmap_prev = le2vma(le, list_link);
c01034cc:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01034cf:	83 e8 10             	sub    $0x10,%eax
c01034d2:	89 45 e8             	mov    %eax,-0x18(%ebp)
            if (mmap_prev->vm_start > vma->vm_start) {
c01034d5:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01034d8:	8b 50 04             	mov    0x4(%eax),%edx
c01034db:	8b 45 0c             	mov    0xc(%ebp),%eax
c01034de:	8b 40 04             	mov    0x4(%eax),%eax
c01034e1:	39 c2                	cmp    %eax,%edx
c01034e3:	77 1f                	ja     c0103504 <insert_vma_struct+0x7c>
                break;
            }
            le_prev = le;
c01034e5:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01034e8:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01034eb:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01034ee:	89 45 e0             	mov    %eax,-0x20(%ebp)
c01034f1:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01034f4:	8b 40 04             	mov    0x4(%eax),%eax
        while ((le = list_next(le)) != list) {
c01034f7:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01034fa:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01034fd:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c0103500:	75 ca                	jne    c01034cc <insert_vma_struct+0x44>
c0103502:	eb 01                	jmp    c0103505 <insert_vma_struct+0x7d>
                break;
c0103504:	90                   	nop
c0103505:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103508:	89 45 dc             	mov    %eax,-0x24(%ebp)
c010350b:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010350e:	8b 40 04             	mov    0x4(%eax),%eax
        }

    le_next = list_next(le_prev);
c0103511:	89 45 e4             	mov    %eax,-0x1c(%ebp)

    /* check overlap */
    if (le_prev != list) {
c0103514:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103517:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c010351a:	74 15                	je     c0103531 <insert_vma_struct+0xa9>
        check_vma_overlap(le2vma(le_prev, list_link), vma);
c010351c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010351f:	83 e8 10             	sub    $0x10,%eax
c0103522:	83 ec 08             	sub    $0x8,%esp
c0103525:	ff 75 0c             	pushl  0xc(%ebp)
c0103528:	50                   	push   %eax
c0103529:	e8 df fe ff ff       	call   c010340d <check_vma_overlap>
c010352e:	83 c4 10             	add    $0x10,%esp
    }
    if (le_next != list) {
c0103531:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0103534:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c0103537:	74 15                	je     c010354e <insert_vma_struct+0xc6>
        check_vma_overlap(vma, le2vma(le_next, list_link));
c0103539:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010353c:	83 e8 10             	sub    $0x10,%eax
c010353f:	83 ec 08             	sub    $0x8,%esp
c0103542:	50                   	push   %eax
c0103543:	ff 75 0c             	pushl  0xc(%ebp)
c0103546:	e8 c2 fe ff ff       	call   c010340d <check_vma_overlap>
c010354b:	83 c4 10             	add    $0x10,%esp
    }

    vma->vm_mm = mm;
c010354e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103551:	8b 55 08             	mov    0x8(%ebp),%edx
c0103554:	89 10                	mov    %edx,(%eax)
    list_add_after(le_prev, &(vma->list_link));
c0103556:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103559:	8d 50 10             	lea    0x10(%eax),%edx
c010355c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010355f:	89 45 d8             	mov    %eax,-0x28(%ebp)
c0103562:	89 55 d4             	mov    %edx,-0x2c(%ebp)
    __list_add(elm, listelm, listelm->next);
c0103565:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0103568:	8b 40 04             	mov    0x4(%eax),%eax
c010356b:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c010356e:	89 55 d0             	mov    %edx,-0x30(%ebp)
c0103571:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0103574:	89 55 cc             	mov    %edx,-0x34(%ebp)
c0103577:	89 45 c8             	mov    %eax,-0x38(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_add(list_entry_t *elm, list_entry_t *prev, list_entry_t *next) {
    prev->next = next->prev = elm;
c010357a:	8b 45 c8             	mov    -0x38(%ebp),%eax
c010357d:	8b 55 d0             	mov    -0x30(%ebp),%edx
c0103580:	89 10                	mov    %edx,(%eax)
c0103582:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0103585:	8b 10                	mov    (%eax),%edx
c0103587:	8b 45 cc             	mov    -0x34(%ebp),%eax
c010358a:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c010358d:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0103590:	8b 55 c8             	mov    -0x38(%ebp),%edx
c0103593:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0103596:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0103599:	8b 55 cc             	mov    -0x34(%ebp),%edx
c010359c:	89 10                	mov    %edx,(%eax)
}
c010359e:	90                   	nop
}
c010359f:	90                   	nop

    mm->map_count ++;
c01035a0:	8b 45 08             	mov    0x8(%ebp),%eax
c01035a3:	8b 40 10             	mov    0x10(%eax),%eax
c01035a6:	8d 50 01             	lea    0x1(%eax),%edx
c01035a9:	8b 45 08             	mov    0x8(%ebp),%eax
c01035ac:	89 50 10             	mov    %edx,0x10(%eax)
}
c01035af:	90                   	nop
c01035b0:	c9                   	leave  
c01035b1:	c3                   	ret    

c01035b2 <mm_destroy>:

// mm_destroy - free mm and mm internal fields
void
mm_destroy(struct mm_struct *mm) {
c01035b2:	f3 0f 1e fb          	endbr32 
c01035b6:	55                   	push   %ebp
c01035b7:	89 e5                	mov    %esp,%ebp
c01035b9:	83 ec 28             	sub    $0x28,%esp

    list_entry_t *list = &(mm->mmap_list), *le;
c01035bc:	8b 45 08             	mov    0x8(%ebp),%eax
c01035bf:	89 45 f4             	mov    %eax,-0xc(%ebp)
    while ((le = list_next(list)) != list) {
c01035c2:	eb 3e                	jmp    c0103602 <mm_destroy+0x50>
c01035c4:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01035c7:	89 45 ec             	mov    %eax,-0x14(%ebp)
    __list_del(listelm->prev, listelm->next);
c01035ca:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01035cd:	8b 40 04             	mov    0x4(%eax),%eax
c01035d0:	8b 55 ec             	mov    -0x14(%ebp),%edx
c01035d3:	8b 12                	mov    (%edx),%edx
c01035d5:	89 55 e8             	mov    %edx,-0x18(%ebp)
c01035d8:	89 45 e4             	mov    %eax,-0x1c(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_del(list_entry_t *prev, list_entry_t *next) {
    prev->next = next;
c01035db:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01035de:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c01035e1:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c01035e4:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01035e7:	8b 55 e8             	mov    -0x18(%ebp),%edx
c01035ea:	89 10                	mov    %edx,(%eax)
}
c01035ec:	90                   	nop
}
c01035ed:	90                   	nop
        list_del(le);
        kfree(le2vma(le, list_link),sizeof(struct vma_struct));  //kfree vma        
c01035ee:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01035f1:	83 e8 10             	sub    $0x10,%eax
c01035f4:	83 ec 08             	sub    $0x8,%esp
c01035f7:	6a 18                	push   $0x18
c01035f9:	50                   	push   %eax
c01035fa:	e8 88 40 00 00       	call   c0107687 <kfree>
c01035ff:	83 c4 10             	add    $0x10,%esp
c0103602:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103605:	89 45 e0             	mov    %eax,-0x20(%ebp)
    return listelm->next;
c0103608:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010360b:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(list)) != list) {
c010360e:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0103611:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103614:	3b 45 f4             	cmp    -0xc(%ebp),%eax
c0103617:	75 ab                	jne    c01035c4 <mm_destroy+0x12>
    }
    kfree(mm, sizeof(struct mm_struct)); //kfree mm
c0103619:	83 ec 08             	sub    $0x8,%esp
c010361c:	6a 18                	push   $0x18
c010361e:	ff 75 08             	pushl  0x8(%ebp)
c0103621:	e8 61 40 00 00       	call   c0107687 <kfree>
c0103626:	83 c4 10             	add    $0x10,%esp
    mm=NULL;
c0103629:	c7 45 08 00 00 00 00 	movl   $0x0,0x8(%ebp)
}
c0103630:	90                   	nop
c0103631:	c9                   	leave  
c0103632:	c3                   	ret    

c0103633 <vmm_init>:

// vmm_init - initialize virtual memory management
//          - now just call check_vmm to check correctness of vmm
void
vmm_init(void) {
c0103633:	f3 0f 1e fb          	endbr32 
c0103637:	55                   	push   %ebp
c0103638:	89 e5                	mov    %esp,%ebp
c010363a:	83 ec 08             	sub    $0x8,%esp
    check_vmm();
c010363d:	e8 03 00 00 00       	call   c0103645 <check_vmm>
}
c0103642:	90                   	nop
c0103643:	c9                   	leave  
c0103644:	c3                   	ret    

c0103645 <check_vmm>:

// check_vmm - check correctness of vmm
static void
check_vmm(void) {
c0103645:	f3 0f 1e fb          	endbr32 
c0103649:	55                   	push   %ebp
c010364a:	89 e5                	mov    %esp,%ebp
c010364c:	83 ec 18             	sub    $0x18,%esp
    size_t nr_free_pages_store = nr_free_pages();
c010364f:	e8 a0 2c 00 00       	call   c01062f4 <nr_free_pages>
c0103654:	89 45 f4             	mov    %eax,-0xc(%ebp)
    
    check_vma_struct();
c0103657:	e8 3b 00 00 00       	call   c0103697 <check_vma_struct>
    check_pgfault();
c010365c:	e8 5a 04 00 00       	call   c0103abb <check_pgfault>

    assert(nr_free_pages_store == nr_free_pages());
c0103661:	e8 8e 2c 00 00       	call   c01062f4 <nr_free_pages>
c0103666:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0103669:	74 19                	je     c0103684 <check_vmm+0x3f>
c010366b:	68 5c 8e 10 c0       	push   $0xc0108e5c
c0103670:	68 db 8d 10 c0       	push   $0xc0108ddb
c0103675:	68 a9 00 00 00       	push   $0xa9
c010367a:	68 f0 8d 10 c0       	push   $0xc0108df0
c010367f:	e8 a1 cd ff ff       	call   c0100425 <__panic>

    cprintf("check_vmm() succeeded.\n");
c0103684:	83 ec 0c             	sub    $0xc,%esp
c0103687:	68 83 8e 10 c0       	push   $0xc0108e83
c010368c:	e8 19 cc ff ff       	call   c01002aa <cprintf>
c0103691:	83 c4 10             	add    $0x10,%esp
}
c0103694:	90                   	nop
c0103695:	c9                   	leave  
c0103696:	c3                   	ret    

c0103697 <check_vma_struct>:

static void
check_vma_struct(void) {
c0103697:	f3 0f 1e fb          	endbr32 
c010369b:	55                   	push   %ebp
c010369c:	89 e5                	mov    %esp,%ebp
c010369e:	83 ec 58             	sub    $0x58,%esp
    size_t nr_free_pages_store = nr_free_pages();
c01036a1:	e8 4e 2c 00 00       	call   c01062f4 <nr_free_pages>
c01036a6:	89 45 ec             	mov    %eax,-0x14(%ebp)

    struct mm_struct *mm = mm_create();
c01036a9:	e8 e9 fb ff ff       	call   c0103297 <mm_create>
c01036ae:	89 45 e8             	mov    %eax,-0x18(%ebp)
    assert(mm != NULL);
c01036b1:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c01036b5:	75 19                	jne    c01036d0 <check_vma_struct+0x39>
c01036b7:	68 9b 8e 10 c0       	push   $0xc0108e9b
c01036bc:	68 db 8d 10 c0       	push   $0xc0108ddb
c01036c1:	68 b3 00 00 00       	push   $0xb3
c01036c6:	68 f0 8d 10 c0       	push   $0xc0108df0
c01036cb:	e8 55 cd ff ff       	call   c0100425 <__panic>

    int step1 = 10, step2 = step1 * 10;
c01036d0:	c7 45 e4 0a 00 00 00 	movl   $0xa,-0x1c(%ebp)
c01036d7:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c01036da:	89 d0                	mov    %edx,%eax
c01036dc:	c1 e0 02             	shl    $0x2,%eax
c01036df:	01 d0                	add    %edx,%eax
c01036e1:	01 c0                	add    %eax,%eax
c01036e3:	89 45 e0             	mov    %eax,-0x20(%ebp)

    int i;
    for (i = step1; i >= 1; i --) {
c01036e6:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01036e9:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01036ec:	eb 5f                	jmp    c010374d <check_vma_struct+0xb6>
        struct vma_struct *vma = vma_create(i * 5, i * 5 + 2, 0);
c01036ee:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01036f1:	89 d0                	mov    %edx,%eax
c01036f3:	c1 e0 02             	shl    $0x2,%eax
c01036f6:	01 d0                	add    %edx,%eax
c01036f8:	83 c0 02             	add    $0x2,%eax
c01036fb:	89 c1                	mov    %eax,%ecx
c01036fd:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0103700:	89 d0                	mov    %edx,%eax
c0103702:	c1 e0 02             	shl    $0x2,%eax
c0103705:	01 d0                	add    %edx,%eax
c0103707:	83 ec 04             	sub    $0x4,%esp
c010370a:	6a 00                	push   $0x0
c010370c:	51                   	push   %ecx
c010370d:	50                   	push   %eax
c010370e:	e8 05 fc ff ff       	call   c0103318 <vma_create>
c0103713:	83 c4 10             	add    $0x10,%esp
c0103716:	89 45 bc             	mov    %eax,-0x44(%ebp)
        assert(vma != NULL);
c0103719:	83 7d bc 00          	cmpl   $0x0,-0x44(%ebp)
c010371d:	75 19                	jne    c0103738 <check_vma_struct+0xa1>
c010371f:	68 a6 8e 10 c0       	push   $0xc0108ea6
c0103724:	68 db 8d 10 c0       	push   $0xc0108ddb
c0103729:	68 ba 00 00 00       	push   $0xba
c010372e:	68 f0 8d 10 c0       	push   $0xc0108df0
c0103733:	e8 ed cc ff ff       	call   c0100425 <__panic>
        insert_vma_struct(mm, vma);
c0103738:	83 ec 08             	sub    $0x8,%esp
c010373b:	ff 75 bc             	pushl  -0x44(%ebp)
c010373e:	ff 75 e8             	pushl  -0x18(%ebp)
c0103741:	e8 42 fd ff ff       	call   c0103488 <insert_vma_struct>
c0103746:	83 c4 10             	add    $0x10,%esp
    for (i = step1; i >= 1; i --) {
c0103749:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
c010374d:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0103751:	7f 9b                	jg     c01036ee <check_vma_struct+0x57>
    }

    for (i = step1 + 1; i <= step2; i ++) {
c0103753:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0103756:	83 c0 01             	add    $0x1,%eax
c0103759:	89 45 f4             	mov    %eax,-0xc(%ebp)
c010375c:	eb 5f                	jmp    c01037bd <check_vma_struct+0x126>
        struct vma_struct *vma = vma_create(i * 5, i * 5 + 2, 0);
c010375e:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0103761:	89 d0                	mov    %edx,%eax
c0103763:	c1 e0 02             	shl    $0x2,%eax
c0103766:	01 d0                	add    %edx,%eax
c0103768:	83 c0 02             	add    $0x2,%eax
c010376b:	89 c1                	mov    %eax,%ecx
c010376d:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0103770:	89 d0                	mov    %edx,%eax
c0103772:	c1 e0 02             	shl    $0x2,%eax
c0103775:	01 d0                	add    %edx,%eax
c0103777:	83 ec 04             	sub    $0x4,%esp
c010377a:	6a 00                	push   $0x0
c010377c:	51                   	push   %ecx
c010377d:	50                   	push   %eax
c010377e:	e8 95 fb ff ff       	call   c0103318 <vma_create>
c0103783:	83 c4 10             	add    $0x10,%esp
c0103786:	89 45 c0             	mov    %eax,-0x40(%ebp)
        assert(vma != NULL);
c0103789:	83 7d c0 00          	cmpl   $0x0,-0x40(%ebp)
c010378d:	75 19                	jne    c01037a8 <check_vma_struct+0x111>
c010378f:	68 a6 8e 10 c0       	push   $0xc0108ea6
c0103794:	68 db 8d 10 c0       	push   $0xc0108ddb
c0103799:	68 c0 00 00 00       	push   $0xc0
c010379e:	68 f0 8d 10 c0       	push   $0xc0108df0
c01037a3:	e8 7d cc ff ff       	call   c0100425 <__panic>
        insert_vma_struct(mm, vma);
c01037a8:	83 ec 08             	sub    $0x8,%esp
c01037ab:	ff 75 c0             	pushl  -0x40(%ebp)
c01037ae:	ff 75 e8             	pushl  -0x18(%ebp)
c01037b1:	e8 d2 fc ff ff       	call   c0103488 <insert_vma_struct>
c01037b6:	83 c4 10             	add    $0x10,%esp
    for (i = step1 + 1; i <= step2; i ++) {
c01037b9:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c01037bd:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01037c0:	3b 45 e0             	cmp    -0x20(%ebp),%eax
c01037c3:	7e 99                	jle    c010375e <check_vma_struct+0xc7>
    }

    list_entry_t *le = list_next(&(mm->mmap_list));
c01037c5:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01037c8:	89 45 b8             	mov    %eax,-0x48(%ebp)
c01037cb:	8b 45 b8             	mov    -0x48(%ebp),%eax
c01037ce:	8b 40 04             	mov    0x4(%eax),%eax
c01037d1:	89 45 f0             	mov    %eax,-0x10(%ebp)

    for (i = 1; i <= step2; i ++) {
c01037d4:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
c01037db:	e9 81 00 00 00       	jmp    c0103861 <check_vma_struct+0x1ca>
        assert(le != &(mm->mmap_list));
c01037e0:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01037e3:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c01037e6:	75 19                	jne    c0103801 <check_vma_struct+0x16a>
c01037e8:	68 b2 8e 10 c0       	push   $0xc0108eb2
c01037ed:	68 db 8d 10 c0       	push   $0xc0108ddb
c01037f2:	68 c7 00 00 00       	push   $0xc7
c01037f7:	68 f0 8d 10 c0       	push   $0xc0108df0
c01037fc:	e8 24 cc ff ff       	call   c0100425 <__panic>
        struct vma_struct *mmap = le2vma(le, list_link);
c0103801:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103804:	83 e8 10             	sub    $0x10,%eax
c0103807:	89 45 c4             	mov    %eax,-0x3c(%ebp)
        assert(mmap->vm_start == i * 5 && mmap->vm_end == i * 5 + 2);
c010380a:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c010380d:	8b 48 04             	mov    0x4(%eax),%ecx
c0103810:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0103813:	89 d0                	mov    %edx,%eax
c0103815:	c1 e0 02             	shl    $0x2,%eax
c0103818:	01 d0                	add    %edx,%eax
c010381a:	39 c1                	cmp    %eax,%ecx
c010381c:	75 17                	jne    c0103835 <check_vma_struct+0x19e>
c010381e:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0103821:	8b 48 08             	mov    0x8(%eax),%ecx
c0103824:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0103827:	89 d0                	mov    %edx,%eax
c0103829:	c1 e0 02             	shl    $0x2,%eax
c010382c:	01 d0                	add    %edx,%eax
c010382e:	83 c0 02             	add    $0x2,%eax
c0103831:	39 c1                	cmp    %eax,%ecx
c0103833:	74 19                	je     c010384e <check_vma_struct+0x1b7>
c0103835:	68 cc 8e 10 c0       	push   $0xc0108ecc
c010383a:	68 db 8d 10 c0       	push   $0xc0108ddb
c010383f:	68 c9 00 00 00       	push   $0xc9
c0103844:	68 f0 8d 10 c0       	push   $0xc0108df0
c0103849:	e8 d7 cb ff ff       	call   c0100425 <__panic>
c010384e:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103851:	89 45 b4             	mov    %eax,-0x4c(%ebp)
c0103854:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c0103857:	8b 40 04             	mov    0x4(%eax),%eax
        le = list_next(le);
c010385a:	89 45 f0             	mov    %eax,-0x10(%ebp)
    for (i = 1; i <= step2; i ++) {
c010385d:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c0103861:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103864:	3b 45 e0             	cmp    -0x20(%ebp),%eax
c0103867:	0f 8e 73 ff ff ff    	jle    c01037e0 <check_vma_struct+0x149>
    }

    for (i = 5; i <= 5 * step2; i +=5) {
c010386d:	c7 45 f4 05 00 00 00 	movl   $0x5,-0xc(%ebp)
c0103874:	e9 80 01 00 00       	jmp    c01039f9 <check_vma_struct+0x362>
        struct vma_struct *vma1 = find_vma(mm, i);
c0103879:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010387c:	83 ec 08             	sub    $0x8,%esp
c010387f:	50                   	push   %eax
c0103880:	ff 75 e8             	pushl  -0x18(%ebp)
c0103883:	e8 d0 fa ff ff       	call   c0103358 <find_vma>
c0103888:	83 c4 10             	add    $0x10,%esp
c010388b:	89 45 d8             	mov    %eax,-0x28(%ebp)
        assert(vma1 != NULL);
c010388e:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
c0103892:	75 19                	jne    c01038ad <check_vma_struct+0x216>
c0103894:	68 01 8f 10 c0       	push   $0xc0108f01
c0103899:	68 db 8d 10 c0       	push   $0xc0108ddb
c010389e:	68 cf 00 00 00       	push   $0xcf
c01038a3:	68 f0 8d 10 c0       	push   $0xc0108df0
c01038a8:	e8 78 cb ff ff       	call   c0100425 <__panic>
        struct vma_struct *vma2 = find_vma(mm, i+1);
c01038ad:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01038b0:	83 c0 01             	add    $0x1,%eax
c01038b3:	83 ec 08             	sub    $0x8,%esp
c01038b6:	50                   	push   %eax
c01038b7:	ff 75 e8             	pushl  -0x18(%ebp)
c01038ba:	e8 99 fa ff ff       	call   c0103358 <find_vma>
c01038bf:	83 c4 10             	add    $0x10,%esp
c01038c2:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        assert(vma2 != NULL);
c01038c5:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
c01038c9:	75 19                	jne    c01038e4 <check_vma_struct+0x24d>
c01038cb:	68 0e 8f 10 c0       	push   $0xc0108f0e
c01038d0:	68 db 8d 10 c0       	push   $0xc0108ddb
c01038d5:	68 d1 00 00 00       	push   $0xd1
c01038da:	68 f0 8d 10 c0       	push   $0xc0108df0
c01038df:	e8 41 cb ff ff       	call   c0100425 <__panic>
        struct vma_struct *vma3 = find_vma(mm, i+2);
c01038e4:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01038e7:	83 c0 02             	add    $0x2,%eax
c01038ea:	83 ec 08             	sub    $0x8,%esp
c01038ed:	50                   	push   %eax
c01038ee:	ff 75 e8             	pushl  -0x18(%ebp)
c01038f1:	e8 62 fa ff ff       	call   c0103358 <find_vma>
c01038f6:	83 c4 10             	add    $0x10,%esp
c01038f9:	89 45 d0             	mov    %eax,-0x30(%ebp)
        assert(vma3 == NULL);
c01038fc:	83 7d d0 00          	cmpl   $0x0,-0x30(%ebp)
c0103900:	74 19                	je     c010391b <check_vma_struct+0x284>
c0103902:	68 1b 8f 10 c0       	push   $0xc0108f1b
c0103907:	68 db 8d 10 c0       	push   $0xc0108ddb
c010390c:	68 d3 00 00 00       	push   $0xd3
c0103911:	68 f0 8d 10 c0       	push   $0xc0108df0
c0103916:	e8 0a cb ff ff       	call   c0100425 <__panic>
        struct vma_struct *vma4 = find_vma(mm, i+3);
c010391b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010391e:	83 c0 03             	add    $0x3,%eax
c0103921:	83 ec 08             	sub    $0x8,%esp
c0103924:	50                   	push   %eax
c0103925:	ff 75 e8             	pushl  -0x18(%ebp)
c0103928:	e8 2b fa ff ff       	call   c0103358 <find_vma>
c010392d:	83 c4 10             	add    $0x10,%esp
c0103930:	89 45 cc             	mov    %eax,-0x34(%ebp)
        assert(vma4 == NULL);
c0103933:	83 7d cc 00          	cmpl   $0x0,-0x34(%ebp)
c0103937:	74 19                	je     c0103952 <check_vma_struct+0x2bb>
c0103939:	68 28 8f 10 c0       	push   $0xc0108f28
c010393e:	68 db 8d 10 c0       	push   $0xc0108ddb
c0103943:	68 d5 00 00 00       	push   $0xd5
c0103948:	68 f0 8d 10 c0       	push   $0xc0108df0
c010394d:	e8 d3 ca ff ff       	call   c0100425 <__panic>
        struct vma_struct *vma5 = find_vma(mm, i+4);
c0103952:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103955:	83 c0 04             	add    $0x4,%eax
c0103958:	83 ec 08             	sub    $0x8,%esp
c010395b:	50                   	push   %eax
c010395c:	ff 75 e8             	pushl  -0x18(%ebp)
c010395f:	e8 f4 f9 ff ff       	call   c0103358 <find_vma>
c0103964:	83 c4 10             	add    $0x10,%esp
c0103967:	89 45 c8             	mov    %eax,-0x38(%ebp)
        assert(vma5 == NULL);
c010396a:	83 7d c8 00          	cmpl   $0x0,-0x38(%ebp)
c010396e:	74 19                	je     c0103989 <check_vma_struct+0x2f2>
c0103970:	68 35 8f 10 c0       	push   $0xc0108f35
c0103975:	68 db 8d 10 c0       	push   $0xc0108ddb
c010397a:	68 d7 00 00 00       	push   $0xd7
c010397f:	68 f0 8d 10 c0       	push   $0xc0108df0
c0103984:	e8 9c ca ff ff       	call   c0100425 <__panic>

        assert(vma1->vm_start == i  && vma1->vm_end == i  + 2);
c0103989:	8b 45 d8             	mov    -0x28(%ebp),%eax
c010398c:	8b 50 04             	mov    0x4(%eax),%edx
c010398f:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103992:	39 c2                	cmp    %eax,%edx
c0103994:	75 10                	jne    c01039a6 <check_vma_struct+0x30f>
c0103996:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0103999:	8b 40 08             	mov    0x8(%eax),%eax
c010399c:	8b 55 f4             	mov    -0xc(%ebp),%edx
c010399f:	83 c2 02             	add    $0x2,%edx
c01039a2:	39 d0                	cmp    %edx,%eax
c01039a4:	74 19                	je     c01039bf <check_vma_struct+0x328>
c01039a6:	68 44 8f 10 c0       	push   $0xc0108f44
c01039ab:	68 db 8d 10 c0       	push   $0xc0108ddb
c01039b0:	68 d9 00 00 00       	push   $0xd9
c01039b5:	68 f0 8d 10 c0       	push   $0xc0108df0
c01039ba:	e8 66 ca ff ff       	call   c0100425 <__panic>
        assert(vma2->vm_start == i  && vma2->vm_end == i  + 2);
c01039bf:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01039c2:	8b 50 04             	mov    0x4(%eax),%edx
c01039c5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01039c8:	39 c2                	cmp    %eax,%edx
c01039ca:	75 10                	jne    c01039dc <check_vma_struct+0x345>
c01039cc:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01039cf:	8b 40 08             	mov    0x8(%eax),%eax
c01039d2:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01039d5:	83 c2 02             	add    $0x2,%edx
c01039d8:	39 d0                	cmp    %edx,%eax
c01039da:	74 19                	je     c01039f5 <check_vma_struct+0x35e>
c01039dc:	68 74 8f 10 c0       	push   $0xc0108f74
c01039e1:	68 db 8d 10 c0       	push   $0xc0108ddb
c01039e6:	68 da 00 00 00       	push   $0xda
c01039eb:	68 f0 8d 10 c0       	push   $0xc0108df0
c01039f0:	e8 30 ca ff ff       	call   c0100425 <__panic>
    for (i = 5; i <= 5 * step2; i +=5) {
c01039f5:	83 45 f4 05          	addl   $0x5,-0xc(%ebp)
c01039f9:	8b 55 e0             	mov    -0x20(%ebp),%edx
c01039fc:	89 d0                	mov    %edx,%eax
c01039fe:	c1 e0 02             	shl    $0x2,%eax
c0103a01:	01 d0                	add    %edx,%eax
c0103a03:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0103a06:	0f 8e 6d fe ff ff    	jle    c0103879 <check_vma_struct+0x1e2>
    }

    for (i =4; i>=0; i--) {
c0103a0c:	c7 45 f4 04 00 00 00 	movl   $0x4,-0xc(%ebp)
c0103a13:	eb 5c                	jmp    c0103a71 <check_vma_struct+0x3da>
        struct vma_struct *vma_below_5= find_vma(mm,i);
c0103a15:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103a18:	83 ec 08             	sub    $0x8,%esp
c0103a1b:	50                   	push   %eax
c0103a1c:	ff 75 e8             	pushl  -0x18(%ebp)
c0103a1f:	e8 34 f9 ff ff       	call   c0103358 <find_vma>
c0103a24:	83 c4 10             	add    $0x10,%esp
c0103a27:	89 45 dc             	mov    %eax,-0x24(%ebp)
        if (vma_below_5 != NULL ) {
c0103a2a:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
c0103a2e:	74 1e                	je     c0103a4e <check_vma_struct+0x3b7>
           cprintf("vma_below_5: i %x, start %x, end %x\n",i, vma_below_5->vm_start, vma_below_5->vm_end); 
c0103a30:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103a33:	8b 50 08             	mov    0x8(%eax),%edx
c0103a36:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103a39:	8b 40 04             	mov    0x4(%eax),%eax
c0103a3c:	52                   	push   %edx
c0103a3d:	50                   	push   %eax
c0103a3e:	ff 75 f4             	pushl  -0xc(%ebp)
c0103a41:	68 a4 8f 10 c0       	push   $0xc0108fa4
c0103a46:	e8 5f c8 ff ff       	call   c01002aa <cprintf>
c0103a4b:	83 c4 10             	add    $0x10,%esp
        }
        assert(vma_below_5 == NULL);
c0103a4e:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
c0103a52:	74 19                	je     c0103a6d <check_vma_struct+0x3d6>
c0103a54:	68 c9 8f 10 c0       	push   $0xc0108fc9
c0103a59:	68 db 8d 10 c0       	push   $0xc0108ddb
c0103a5e:	68 e2 00 00 00       	push   $0xe2
c0103a63:	68 f0 8d 10 c0       	push   $0xc0108df0
c0103a68:	e8 b8 c9 ff ff       	call   c0100425 <__panic>
    for (i =4; i>=0; i--) {
c0103a6d:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
c0103a71:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0103a75:	79 9e                	jns    c0103a15 <check_vma_struct+0x37e>
    }

    mm_destroy(mm);
c0103a77:	83 ec 0c             	sub    $0xc,%esp
c0103a7a:	ff 75 e8             	pushl  -0x18(%ebp)
c0103a7d:	e8 30 fb ff ff       	call   c01035b2 <mm_destroy>
c0103a82:	83 c4 10             	add    $0x10,%esp

    assert(nr_free_pages_store == nr_free_pages());
c0103a85:	e8 6a 28 00 00       	call   c01062f4 <nr_free_pages>
c0103a8a:	39 45 ec             	cmp    %eax,-0x14(%ebp)
c0103a8d:	74 19                	je     c0103aa8 <check_vma_struct+0x411>
c0103a8f:	68 5c 8e 10 c0       	push   $0xc0108e5c
c0103a94:	68 db 8d 10 c0       	push   $0xc0108ddb
c0103a99:	68 e7 00 00 00       	push   $0xe7
c0103a9e:	68 f0 8d 10 c0       	push   $0xc0108df0
c0103aa3:	e8 7d c9 ff ff       	call   c0100425 <__panic>

    cprintf("check_vma_struct() succeeded!\n");
c0103aa8:	83 ec 0c             	sub    $0xc,%esp
c0103aab:	68 e0 8f 10 c0       	push   $0xc0108fe0
c0103ab0:	e8 f5 c7 ff ff       	call   c01002aa <cprintf>
c0103ab5:	83 c4 10             	add    $0x10,%esp
}
c0103ab8:	90                   	nop
c0103ab9:	c9                   	leave  
c0103aba:	c3                   	ret    

c0103abb <check_pgfault>:

struct mm_struct *check_mm_struct;

// check_pgfault - check correctness of pgfault handler
static void
check_pgfault(void) {
c0103abb:	f3 0f 1e fb          	endbr32 
c0103abf:	55                   	push   %ebp
c0103ac0:	89 e5                	mov    %esp,%ebp
c0103ac2:	83 ec 28             	sub    $0x28,%esp
    size_t nr_free_pages_store = nr_free_pages();
c0103ac5:	e8 2a 28 00 00       	call   c01062f4 <nr_free_pages>
c0103aca:	89 45 ec             	mov    %eax,-0x14(%ebp)

    check_mm_struct = mm_create();
c0103acd:	e8 c5 f7 ff ff       	call   c0103297 <mm_create>
c0103ad2:	a3 10 60 12 c0       	mov    %eax,0xc0126010
    assert(check_mm_struct != NULL);
c0103ad7:	a1 10 60 12 c0       	mov    0xc0126010,%eax
c0103adc:	85 c0                	test   %eax,%eax
c0103ade:	75 19                	jne    c0103af9 <check_pgfault+0x3e>
c0103ae0:	68 ff 8f 10 c0       	push   $0xc0108fff
c0103ae5:	68 db 8d 10 c0       	push   $0xc0108ddb
c0103aea:	68 f4 00 00 00       	push   $0xf4
c0103aef:	68 f0 8d 10 c0       	push   $0xc0108df0
c0103af4:	e8 2c c9 ff ff       	call   c0100425 <__panic>

    struct mm_struct *mm = check_mm_struct;
c0103af9:	a1 10 60 12 c0       	mov    0xc0126010,%eax
c0103afe:	89 45 e8             	mov    %eax,-0x18(%ebp)
    pde_t *pgdir = mm->pgdir = boot_pgdir;
c0103b01:	8b 15 00 2a 12 c0    	mov    0xc0122a00,%edx
c0103b07:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103b0a:	89 50 0c             	mov    %edx,0xc(%eax)
c0103b0d:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103b10:	8b 40 0c             	mov    0xc(%eax),%eax
c0103b13:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    assert(pgdir[0] == 0);
c0103b16:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0103b19:	8b 00                	mov    (%eax),%eax
c0103b1b:	85 c0                	test   %eax,%eax
c0103b1d:	74 19                	je     c0103b38 <check_pgfault+0x7d>
c0103b1f:	68 17 90 10 c0       	push   $0xc0109017
c0103b24:	68 db 8d 10 c0       	push   $0xc0108ddb
c0103b29:	68 f8 00 00 00       	push   $0xf8
c0103b2e:	68 f0 8d 10 c0       	push   $0xc0108df0
c0103b33:	e8 ed c8 ff ff       	call   c0100425 <__panic>

    struct vma_struct *vma = vma_create(0, PTSIZE, VM_WRITE);
c0103b38:	83 ec 04             	sub    $0x4,%esp
c0103b3b:	6a 02                	push   $0x2
c0103b3d:	68 00 00 40 00       	push   $0x400000
c0103b42:	6a 00                	push   $0x0
c0103b44:	e8 cf f7 ff ff       	call   c0103318 <vma_create>
c0103b49:	83 c4 10             	add    $0x10,%esp
c0103b4c:	89 45 e0             	mov    %eax,-0x20(%ebp)
    assert(vma != NULL);
c0103b4f:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c0103b53:	75 19                	jne    c0103b6e <check_pgfault+0xb3>
c0103b55:	68 a6 8e 10 c0       	push   $0xc0108ea6
c0103b5a:	68 db 8d 10 c0       	push   $0xc0108ddb
c0103b5f:	68 fb 00 00 00       	push   $0xfb
c0103b64:	68 f0 8d 10 c0       	push   $0xc0108df0
c0103b69:	e8 b7 c8 ff ff       	call   c0100425 <__panic>

    insert_vma_struct(mm, vma);
c0103b6e:	83 ec 08             	sub    $0x8,%esp
c0103b71:	ff 75 e0             	pushl  -0x20(%ebp)
c0103b74:	ff 75 e8             	pushl  -0x18(%ebp)
c0103b77:	e8 0c f9 ff ff       	call   c0103488 <insert_vma_struct>
c0103b7c:	83 c4 10             	add    $0x10,%esp

    uintptr_t addr = 0x100;
c0103b7f:	c7 45 dc 00 01 00 00 	movl   $0x100,-0x24(%ebp)
    assert(find_vma(mm, addr) == vma);
c0103b86:	83 ec 08             	sub    $0x8,%esp
c0103b89:	ff 75 dc             	pushl  -0x24(%ebp)
c0103b8c:	ff 75 e8             	pushl  -0x18(%ebp)
c0103b8f:	e8 c4 f7 ff ff       	call   c0103358 <find_vma>
c0103b94:	83 c4 10             	add    $0x10,%esp
c0103b97:	39 45 e0             	cmp    %eax,-0x20(%ebp)
c0103b9a:	74 19                	je     c0103bb5 <check_pgfault+0xfa>
c0103b9c:	68 25 90 10 c0       	push   $0xc0109025
c0103ba1:	68 db 8d 10 c0       	push   $0xc0108ddb
c0103ba6:	68 00 01 00 00       	push   $0x100
c0103bab:	68 f0 8d 10 c0       	push   $0xc0108df0
c0103bb0:	e8 70 c8 ff ff       	call   c0100425 <__panic>

    int i, sum = 0;
c0103bb5:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    for (i = 0; i < 100; i ++) {
c0103bbc:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0103bc3:	eb 17                	jmp    c0103bdc <check_pgfault+0x121>
        *(char *)(addr + i) = i;
c0103bc5:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0103bc8:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103bcb:	01 d0                	add    %edx,%eax
c0103bcd:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0103bd0:	88 10                	mov    %dl,(%eax)
        sum += i;
c0103bd2:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103bd5:	01 45 f0             	add    %eax,-0x10(%ebp)
    for (i = 0; i < 100; i ++) {
c0103bd8:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c0103bdc:	83 7d f4 63          	cmpl   $0x63,-0xc(%ebp)
c0103be0:	7e e3                	jle    c0103bc5 <check_pgfault+0x10a>
    }
    for (i = 0; i < 100; i ++) {
c0103be2:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0103be9:	eb 15                	jmp    c0103c00 <check_pgfault+0x145>
        sum -= *(char *)(addr + i);
c0103beb:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0103bee:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103bf1:	01 d0                	add    %edx,%eax
c0103bf3:	0f b6 00             	movzbl (%eax),%eax
c0103bf6:	0f be c0             	movsbl %al,%eax
c0103bf9:	29 45 f0             	sub    %eax,-0x10(%ebp)
    for (i = 0; i < 100; i ++) {
c0103bfc:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c0103c00:	83 7d f4 63          	cmpl   $0x63,-0xc(%ebp)
c0103c04:	7e e5                	jle    c0103beb <check_pgfault+0x130>
    }
    assert(sum == 0);
c0103c06:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0103c0a:	74 19                	je     c0103c25 <check_pgfault+0x16a>
c0103c0c:	68 3f 90 10 c0       	push   $0xc010903f
c0103c11:	68 db 8d 10 c0       	push   $0xc0108ddb
c0103c16:	68 0a 01 00 00       	push   $0x10a
c0103c1b:	68 f0 8d 10 c0       	push   $0xc0108df0
c0103c20:	e8 00 c8 ff ff       	call   c0100425 <__panic>

    page_remove(pgdir, ROUNDDOWN(addr, PGSIZE));
c0103c25:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103c28:	89 45 d8             	mov    %eax,-0x28(%ebp)
c0103c2b:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0103c2e:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0103c33:	83 ec 08             	sub    $0x8,%esp
c0103c36:	50                   	push   %eax
c0103c37:	ff 75 e4             	pushl  -0x1c(%ebp)
c0103c3a:	e8 d8 2c 00 00       	call   c0106917 <page_remove>
c0103c3f:	83 c4 10             	add    $0x10,%esp
    free_page(pde2page(pgdir[0]));
c0103c42:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0103c45:	8b 00                	mov    (%eax),%eax
c0103c47:	83 ec 0c             	sub    $0xc,%esp
c0103c4a:	50                   	push   %eax
c0103c4b:	e8 2b f6 ff ff       	call   c010327b <pde2page>
c0103c50:	83 c4 10             	add    $0x10,%esp
c0103c53:	83 ec 08             	sub    $0x8,%esp
c0103c56:	6a 01                	push   $0x1
c0103c58:	50                   	push   %eax
c0103c59:	e8 5d 26 00 00       	call   c01062bb <free_pages>
c0103c5e:	83 c4 10             	add    $0x10,%esp
    pgdir[0] = 0;
c0103c61:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0103c64:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    mm->pgdir = NULL;
c0103c6a:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103c6d:	c7 40 0c 00 00 00 00 	movl   $0x0,0xc(%eax)
    mm_destroy(mm);
c0103c74:	83 ec 0c             	sub    $0xc,%esp
c0103c77:	ff 75 e8             	pushl  -0x18(%ebp)
c0103c7a:	e8 33 f9 ff ff       	call   c01035b2 <mm_destroy>
c0103c7f:	83 c4 10             	add    $0x10,%esp
    check_mm_struct = NULL;
c0103c82:	c7 05 10 60 12 c0 00 	movl   $0x0,0xc0126010
c0103c89:	00 00 00 

    assert(nr_free_pages_store == nr_free_pages());
c0103c8c:	e8 63 26 00 00       	call   c01062f4 <nr_free_pages>
c0103c91:	39 45 ec             	cmp    %eax,-0x14(%ebp)
c0103c94:	74 19                	je     c0103caf <check_pgfault+0x1f4>
c0103c96:	68 5c 8e 10 c0       	push   $0xc0108e5c
c0103c9b:	68 db 8d 10 c0       	push   $0xc0108ddb
c0103ca0:	68 14 01 00 00       	push   $0x114
c0103ca5:	68 f0 8d 10 c0       	push   $0xc0108df0
c0103caa:	e8 76 c7 ff ff       	call   c0100425 <__panic>

    cprintf("check_pgfault() succeeded!\n");
c0103caf:	83 ec 0c             	sub    $0xc,%esp
c0103cb2:	68 48 90 10 c0       	push   $0xc0109048
c0103cb7:	e8 ee c5 ff ff       	call   c01002aa <cprintf>
c0103cbc:	83 c4 10             	add    $0x10,%esp
}
c0103cbf:	90                   	nop
c0103cc0:	c9                   	leave  
c0103cc1:	c3                   	ret    

c0103cc2 <do_pgfault>:
 *            was a read (0) or write (1).
 *         -- The U/S flag (bit 2) indicates whether the processor was executing at user mode (1)
 *            or supervisor mode (0) at the time of the exception.
 */
int
do_pgfault(struct mm_struct *mm, uint32_t error_code, uintptr_t addr) {
c0103cc2:	f3 0f 1e fb          	endbr32 
c0103cc6:	55                   	push   %ebp
c0103cc7:	89 e5                	mov    %esp,%ebp
c0103cc9:	83 ec 28             	sub    $0x28,%esp
    int ret = -E_INVAL;
c0103ccc:	c7 45 f4 fd ff ff ff 	movl   $0xfffffffd,-0xc(%ebp)
    //try to find a vma which include addr
    struct vma_struct *vma = find_vma(mm, addr);
c0103cd3:	ff 75 10             	pushl  0x10(%ebp)
c0103cd6:	ff 75 08             	pushl  0x8(%ebp)
c0103cd9:	e8 7a f6 ff ff       	call   c0103358 <find_vma>
c0103cde:	83 c4 08             	add    $0x8,%esp
c0103ce1:	89 45 ec             	mov    %eax,-0x14(%ebp)

    pgfault_num++;
c0103ce4:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c0103ce9:	83 c0 01             	add    $0x1,%eax
c0103cec:	a3 64 5f 12 c0       	mov    %eax,0xc0125f64
    //If the addr is in the range of a mm's vma?
    if (vma == NULL || vma->vm_start > addr) {
c0103cf1:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c0103cf5:	74 0b                	je     c0103d02 <do_pgfault+0x40>
c0103cf7:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103cfa:	8b 40 04             	mov    0x4(%eax),%eax
c0103cfd:	39 45 10             	cmp    %eax,0x10(%ebp)
c0103d00:	73 18                	jae    c0103d1a <do_pgfault+0x58>
        cprintf("not valid addr %x, and  can not find it in vma\n", addr);
c0103d02:	83 ec 08             	sub    $0x8,%esp
c0103d05:	ff 75 10             	pushl  0x10(%ebp)
c0103d08:	68 64 90 10 c0       	push   $0xc0109064
c0103d0d:	e8 98 c5 ff ff       	call   c01002aa <cprintf>
c0103d12:	83 c4 10             	add    $0x10,%esp
        goto failed;
c0103d15:	e9 aa 01 00 00       	jmp    c0103ec4 <do_pgfault+0x202>
    }
    //check the error_code
    switch (error_code & 3) {
c0103d1a:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103d1d:	83 e0 03             	and    $0x3,%eax
c0103d20:	85 c0                	test   %eax,%eax
c0103d22:	74 3c                	je     c0103d60 <do_pgfault+0x9e>
c0103d24:	83 f8 01             	cmp    $0x1,%eax
c0103d27:	74 22                	je     c0103d4b <do_pgfault+0x89>
    default:
            /* error code flag : default is 3 ( W/R=1, P=1): write, present */
    case 2: /* error code flag : (W/R=1, P=0): write, not present */
        if (!(vma->vm_flags & VM_WRITE)) {
c0103d29:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103d2c:	8b 40 0c             	mov    0xc(%eax),%eax
c0103d2f:	83 e0 02             	and    $0x2,%eax
c0103d32:	85 c0                	test   %eax,%eax
c0103d34:	75 4c                	jne    c0103d82 <do_pgfault+0xc0>
            cprintf("do_pgfault failed: error code flag = write AND not present, but the addr's vma cannot write\n");
c0103d36:	83 ec 0c             	sub    $0xc,%esp
c0103d39:	68 94 90 10 c0       	push   $0xc0109094
c0103d3e:	e8 67 c5 ff ff       	call   c01002aa <cprintf>
c0103d43:	83 c4 10             	add    $0x10,%esp
            goto failed;
c0103d46:	e9 79 01 00 00       	jmp    c0103ec4 <do_pgfault+0x202>
        }
        break;
    case 1: /* error code flag : (W/R=0, P=1): read, present */
        cprintf("do_pgfault failed: error code flag = read AND present\n");
c0103d4b:	83 ec 0c             	sub    $0xc,%esp
c0103d4e:	68 f4 90 10 c0       	push   $0xc01090f4
c0103d53:	e8 52 c5 ff ff       	call   c01002aa <cprintf>
c0103d58:	83 c4 10             	add    $0x10,%esp
        goto failed;
c0103d5b:	e9 64 01 00 00       	jmp    c0103ec4 <do_pgfault+0x202>
    case 0: /* error code flag : (W/R=0, P=0): read, not present */
        if (!(vma->vm_flags & (VM_READ | VM_EXEC))) {
c0103d60:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103d63:	8b 40 0c             	mov    0xc(%eax),%eax
c0103d66:	83 e0 05             	and    $0x5,%eax
c0103d69:	85 c0                	test   %eax,%eax
c0103d6b:	75 16                	jne    c0103d83 <do_pgfault+0xc1>
            cprintf("do_pgfault failed: error code flag = read AND not present, but the addr's vma cannot read or exec\n");
c0103d6d:	83 ec 0c             	sub    $0xc,%esp
c0103d70:	68 2c 91 10 c0       	push   $0xc010912c
c0103d75:	e8 30 c5 ff ff       	call   c01002aa <cprintf>
c0103d7a:	83 c4 10             	add    $0x10,%esp
            goto failed;
c0103d7d:	e9 42 01 00 00       	jmp    c0103ec4 <do_pgfault+0x202>
        break;
c0103d82:	90                   	nop
     *    (write an non_existed addr && addr is writable) OR
     *    (read  an non_existed addr && addr is readable)
     * THEN
     *    continue process
     */
    uint32_t perm = PTE_U;
c0103d83:	c7 45 f0 04 00 00 00 	movl   $0x4,-0x10(%ebp)
    if (vma->vm_flags & VM_WRITE) {
c0103d8a:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103d8d:	8b 40 0c             	mov    0xc(%eax),%eax
c0103d90:	83 e0 02             	and    $0x2,%eax
c0103d93:	85 c0                	test   %eax,%eax
c0103d95:	74 04                	je     c0103d9b <do_pgfault+0xd9>
        perm |= PTE_W;
c0103d97:	83 4d f0 02          	orl    $0x2,-0x10(%ebp)
    }
    addr = ROUNDDOWN(addr, PGSIZE);
c0103d9b:	8b 45 10             	mov    0x10(%ebp),%eax
c0103d9e:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0103da1:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103da4:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0103da9:	89 45 10             	mov    %eax,0x10(%ebp)

    ret = -E_NO_MEM;
c0103dac:	c7 45 f4 fc ff ff ff 	movl   $0xfffffffc,-0xc(%ebp)

    pte_t *ptep=NULL;
c0103db3:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
    *
    */

    // try to find a pte, if pte's PT(Page Table) isn't existed, then create a PT.
    // (notice the 3th parameter '1')
    if ((ptep = get_pte(mm->pgdir, addr, 1)) == NULL) {
c0103dba:	8b 45 08             	mov    0x8(%ebp),%eax
c0103dbd:	8b 40 0c             	mov    0xc(%eax),%eax
c0103dc0:	83 ec 04             	sub    $0x4,%esp
c0103dc3:	6a 01                	push   $0x1
c0103dc5:	ff 75 10             	pushl  0x10(%ebp)
c0103dc8:	50                   	push   %eax
c0103dc9:	e8 e2 2a 00 00       	call   c01068b0 <get_pte>
c0103dce:	83 c4 10             	add    $0x10,%esp
c0103dd1:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0103dd4:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c0103dd8:	75 15                	jne    c0103def <do_pgfault+0x12d>
        cprintf("get_pte in do_pgfault failed\n");
c0103dda:	83 ec 0c             	sub    $0xc,%esp
c0103ddd:	68 8f 91 10 c0       	push   $0xc010918f
c0103de2:	e8 c3 c4 ff ff       	call   c01002aa <cprintf>
c0103de7:	83 c4 10             	add    $0x10,%esp
        goto failed;
c0103dea:	e9 d5 00 00 00       	jmp    c0103ec4 <do_pgfault+0x202>
    }
    
    if (*ptep == 0) { // if the phy addr isn't exist, then alloc a page & map the phy addr with logical addr
c0103def:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0103df2:	8b 00                	mov    (%eax),%eax
c0103df4:	85 c0                	test   %eax,%eax
c0103df6:	75 35                	jne    c0103e2d <do_pgfault+0x16b>
        if (pgdir_alloc_page(mm->pgdir, addr, perm) == NULL) {
c0103df8:	8b 45 08             	mov    0x8(%ebp),%eax
c0103dfb:	8b 40 0c             	mov    0xc(%eax),%eax
c0103dfe:	83 ec 04             	sub    $0x4,%esp
c0103e01:	ff 75 f0             	pushl  -0x10(%ebp)
c0103e04:	ff 75 10             	pushl  0x10(%ebp)
c0103e07:	50                   	push   %eax
c0103e08:	e8 4d 2c 00 00       	call   c0106a5a <pgdir_alloc_page>
c0103e0d:	83 c4 10             	add    $0x10,%esp
c0103e10:	85 c0                	test   %eax,%eax
c0103e12:	0f 85 a5 00 00 00    	jne    c0103ebd <do_pgfault+0x1fb>
            cprintf("pgdir_alloc_page in do_pgfault failed\n");
c0103e18:	83 ec 0c             	sub    $0xc,%esp
c0103e1b:	68 b0 91 10 c0       	push   $0xc01091b0
c0103e20:	e8 85 c4 ff ff       	call   c01002aa <cprintf>
c0103e25:	83 c4 10             	add    $0x10,%esp
            goto failed;
c0103e28:	e9 97 00 00 00       	jmp    c0103ec4 <do_pgfault+0x202>
        }
    }
    else { // if this pte is a swap entry, then load data from disk to a page with phy addr
           // and call page_insert to map the phy addr with logical addr
        if(swap_init_ok) {
c0103e2d:	a1 68 5f 12 c0       	mov    0xc0125f68,%eax
c0103e32:	85 c0                	test   %eax,%eax
c0103e34:	74 6f                	je     c0103ea5 <do_pgfault+0x1e3>
            struct Page *page=NULL;
c0103e36:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
            if ((ret = swap_in(mm, addr, &page)) != 0) {
c0103e3d:	83 ec 04             	sub    $0x4,%esp
c0103e40:	8d 45 e0             	lea    -0x20(%ebp),%eax
c0103e43:	50                   	push   %eax
c0103e44:	ff 75 10             	pushl  0x10(%ebp)
c0103e47:	ff 75 08             	pushl  0x8(%ebp)
c0103e4a:	e8 ee 07 00 00       	call   c010463d <swap_in>
c0103e4f:	83 c4 10             	add    $0x10,%esp
c0103e52:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0103e55:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0103e59:	74 12                	je     c0103e6d <do_pgfault+0x1ab>
                cprintf("swap_in in do_pgfault failed\n");
c0103e5b:	83 ec 0c             	sub    $0xc,%esp
c0103e5e:	68 d7 91 10 c0       	push   $0xc01091d7
c0103e63:	e8 42 c4 ff ff       	call   c01002aa <cprintf>
c0103e68:	83 c4 10             	add    $0x10,%esp
c0103e6b:	eb 57                	jmp    c0103ec4 <do_pgfault+0x202>
                goto failed;
            }    
            page_insert(mm->pgdir, page, addr, perm);
c0103e6d:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0103e70:	8b 45 08             	mov    0x8(%ebp),%eax
c0103e73:	8b 40 0c             	mov    0xc(%eax),%eax
c0103e76:	ff 75 f0             	pushl  -0x10(%ebp)
c0103e79:	ff 75 10             	pushl  0x10(%ebp)
c0103e7c:	52                   	push   %edx
c0103e7d:	50                   	push   %eax
c0103e7e:	e8 cb 2a 00 00       	call   c010694e <page_insert>
c0103e83:	83 c4 10             	add    $0x10,%esp
            swap_map_swappable(mm, addr, page, 1);
c0103e86:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0103e89:	6a 01                	push   $0x1
c0103e8b:	50                   	push   %eax
c0103e8c:	ff 75 10             	pushl  0x10(%ebp)
c0103e8f:	ff 75 08             	pushl  0x8(%ebp)
c0103e92:	e8 0a 06 00 00       	call   c01044a1 <swap_map_swappable>
c0103e97:	83 c4 10             	add    $0x10,%esp
            page->pra_vaddr = addr;
c0103e9a:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0103e9d:	8b 55 10             	mov    0x10(%ebp),%edx
c0103ea0:	89 50 1c             	mov    %edx,0x1c(%eax)
c0103ea3:	eb 18                	jmp    c0103ebd <do_pgfault+0x1fb>
        }
        else {
            cprintf("no swap_init_ok but ptep is %x, failed\n",*ptep);
c0103ea5:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0103ea8:	8b 00                	mov    (%eax),%eax
c0103eaa:	83 ec 08             	sub    $0x8,%esp
c0103ead:	50                   	push   %eax
c0103eae:	68 f8 91 10 c0       	push   $0xc01091f8
c0103eb3:	e8 f2 c3 ff ff       	call   c01002aa <cprintf>
c0103eb8:	83 c4 10             	add    $0x10,%esp
            goto failed;
c0103ebb:	eb 07                	jmp    c0103ec4 <do_pgfault+0x202>
        }
   }
   ret = 0;
c0103ebd:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
failed:
    return ret;
c0103ec4:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0103ec7:	c9                   	leave  
c0103ec8:	c3                   	ret    

c0103ec9 <_fifo_init_mm>:
 * (2) _fifo_init_mm: init pra_list_head and let  mm->sm_priv point to the addr of pra_list_head.
 *              Now, From the memory control struct mm_struct, we can access FIFO PRA
 */
static int
_fifo_init_mm(struct mm_struct *mm)
{     
c0103ec9:	f3 0f 1e fb          	endbr32 
c0103ecd:	55                   	push   %ebp
c0103ece:	89 e5                	mov    %esp,%ebp
c0103ed0:	83 ec 10             	sub    $0x10,%esp
c0103ed3:	c7 45 fc 14 60 12 c0 	movl   $0xc0126014,-0x4(%ebp)
    elm->prev = elm->next = elm;
c0103eda:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0103edd:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0103ee0:	89 50 04             	mov    %edx,0x4(%eax)
c0103ee3:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0103ee6:	8b 50 04             	mov    0x4(%eax),%edx
c0103ee9:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0103eec:	89 10                	mov    %edx,(%eax)
}
c0103eee:	90                   	nop
     list_init(&pra_list_head);
     mm->sm_priv = &pra_list_head;
c0103eef:	8b 45 08             	mov    0x8(%ebp),%eax
c0103ef2:	c7 40 14 14 60 12 c0 	movl   $0xc0126014,0x14(%eax)
     //cprintf(" mm->sm_priv %x in fifo_init_mm\n",mm->sm_priv);
     return 0;
c0103ef9:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0103efe:	c9                   	leave  
c0103eff:	c3                   	ret    

c0103f00 <_fifo_map_swappable>:
/*
 * (3)_fifo_map_swappable: According FIFO PRA, we should link the most recent arrival page at the back of pra_list_head qeueue
 */
static int
_fifo_map_swappable(struct mm_struct *mm, uintptr_t addr, struct Page *page, int swap_in)
{
c0103f00:	f3 0f 1e fb          	endbr32 
c0103f04:	55                   	push   %ebp
c0103f05:	89 e5                	mov    %esp,%ebp
c0103f07:	83 ec 38             	sub    $0x38,%esp
    list_entry_t *head=(list_entry_t*) mm->sm_priv;
c0103f0a:	8b 45 08             	mov    0x8(%ebp),%eax
c0103f0d:	8b 40 14             	mov    0x14(%eax),%eax
c0103f10:	89 45 f4             	mov    %eax,-0xc(%ebp)
    list_entry_t *entry=&(page->pra_page_link);
c0103f13:	8b 45 10             	mov    0x10(%ebp),%eax
c0103f16:	83 c0 14             	add    $0x14,%eax
c0103f19:	89 45 f0             	mov    %eax,-0x10(%ebp)
 
    assert(entry != NULL && head != NULL);
c0103f1c:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0103f20:	74 06                	je     c0103f28 <_fifo_map_swappable+0x28>
c0103f22:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0103f26:	75 16                	jne    c0103f3e <_fifo_map_swappable+0x3e>
c0103f28:	68 20 92 10 c0       	push   $0xc0109220
c0103f2d:	68 3e 92 10 c0       	push   $0xc010923e
c0103f32:	6a 32                	push   $0x32
c0103f34:	68 53 92 10 c0       	push   $0xc0109253
c0103f39:	e8 e7 c4 ff ff       	call   c0100425 <__panic>
c0103f3e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103f41:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0103f44:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103f47:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0103f4a:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103f4d:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0103f50:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103f53:	89 45 e0             	mov    %eax,-0x20(%ebp)
    __list_add(elm, listelm, listelm->next);
c0103f56:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0103f59:	8b 40 04             	mov    0x4(%eax),%eax
c0103f5c:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0103f5f:	89 55 dc             	mov    %edx,-0x24(%ebp)
c0103f62:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0103f65:	89 55 d8             	mov    %edx,-0x28(%ebp)
c0103f68:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    prev->next = next->prev = elm;
c0103f6b:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0103f6e:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0103f71:	89 10                	mov    %edx,(%eax)
c0103f73:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0103f76:	8b 10                	mov    (%eax),%edx
c0103f78:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0103f7b:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0103f7e:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103f81:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0103f84:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0103f87:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103f8a:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0103f8d:	89 10                	mov    %edx,(%eax)
}
c0103f8f:	90                   	nop
}
c0103f90:	90                   	nop
}
c0103f91:	90                   	nop
    //record the page access situlation
    //(1)link the most recent arrival page at the back of the pra_list_head qeueue.
    list_add(head, entry);
    return 0;
c0103f92:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0103f97:	c9                   	leave  
c0103f98:	c3                   	ret    

c0103f99 <_fifo_swap_out_victim>:
 *  (4)_fifo_swap_out_victim: According FIFO PRA, we should unlink the  earliest arrival page in front of pra_list_head qeueue,
 *                            then assign the value of *ptr_page to the addr of this page.
 */
static int
_fifo_swap_out_victim(struct mm_struct *mm, struct Page ** ptr_page, int in_tick)
{
c0103f99:	f3 0f 1e fb          	endbr32 
c0103f9d:	55                   	push   %ebp
c0103f9e:	89 e5                	mov    %esp,%ebp
c0103fa0:	83 ec 28             	sub    $0x28,%esp
     list_entry_t *head=(list_entry_t*) mm->sm_priv;
c0103fa3:	8b 45 08             	mov    0x8(%ebp),%eax
c0103fa6:	8b 40 14             	mov    0x14(%eax),%eax
c0103fa9:	89 45 f4             	mov    %eax,-0xc(%ebp)
         assert(head != NULL);
c0103fac:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0103fb0:	75 16                	jne    c0103fc8 <_fifo_swap_out_victim+0x2f>
c0103fb2:	68 67 92 10 c0       	push   $0xc0109267
c0103fb7:	68 3e 92 10 c0       	push   $0xc010923e
c0103fbc:	6a 40                	push   $0x40
c0103fbe:	68 53 92 10 c0       	push   $0xc0109253
c0103fc3:	e8 5d c4 ff ff       	call   c0100425 <__panic>
     assert(in_tick==0);
c0103fc8:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0103fcc:	74 16                	je     c0103fe4 <_fifo_swap_out_victim+0x4b>
c0103fce:	68 74 92 10 c0       	push   $0xc0109274
c0103fd3:	68 3e 92 10 c0       	push   $0xc010923e
c0103fd8:	6a 41                	push   $0x41
c0103fda:	68 53 92 10 c0       	push   $0xc0109253
c0103fdf:	e8 41 c4 ff ff       	call   c0100425 <__panic>
     /* Select the victim */
     /* Select the tail */
     list_entry_t *le = head->prev;
c0103fe4:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103fe7:	8b 00                	mov    (%eax),%eax
c0103fe9:	89 45 f0             	mov    %eax,-0x10(%ebp)
     assert(head!=le);
c0103fec:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103fef:	3b 45 f0             	cmp    -0x10(%ebp),%eax
c0103ff2:	75 16                	jne    c010400a <_fifo_swap_out_victim+0x71>
c0103ff4:	68 7f 92 10 c0       	push   $0xc010927f
c0103ff9:	68 3e 92 10 c0       	push   $0xc010923e
c0103ffe:	6a 45                	push   $0x45
c0104000:	68 53 92 10 c0       	push   $0xc0109253
c0104005:	e8 1b c4 ff ff       	call   c0100425 <__panic>
     struct Page *p = le2page(le, pra_page_link);
c010400a:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010400d:	83 e8 14             	sub    $0x14,%eax
c0104010:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0104013:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104016:	89 45 e8             	mov    %eax,-0x18(%ebp)
    __list_del(listelm->prev, listelm->next);
c0104019:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010401c:	8b 40 04             	mov    0x4(%eax),%eax
c010401f:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0104022:	8b 12                	mov    (%edx),%edx
c0104024:	89 55 e4             	mov    %edx,-0x1c(%ebp)
c0104027:	89 45 e0             	mov    %eax,-0x20(%ebp)
    prev->next = next;
c010402a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010402d:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0104030:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c0104033:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0104036:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0104039:	89 10                	mov    %edx,(%eax)
}
c010403b:	90                   	nop
}
c010403c:	90                   	nop
     list_del(le);
     assert(p !=NULL);
c010403d:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c0104041:	75 16                	jne    c0104059 <_fifo_swap_out_victim+0xc0>
c0104043:	68 88 92 10 c0       	push   $0xc0109288
c0104048:	68 3e 92 10 c0       	push   $0xc010923e
c010404d:	6a 48                	push   $0x48
c010404f:	68 53 92 10 c0       	push   $0xc0109253
c0104054:	e8 cc c3 ff ff       	call   c0100425 <__panic>
     *ptr_page = p;
c0104059:	8b 45 0c             	mov    0xc(%ebp),%eax
c010405c:	8b 55 ec             	mov    -0x14(%ebp),%edx
c010405f:	89 10                	mov    %edx,(%eax)
     return 0;
c0104061:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0104066:	c9                   	leave  
c0104067:	c3                   	ret    

c0104068 <_fifo_check_swap>:

static int
_fifo_check_swap(void) {
c0104068:	f3 0f 1e fb          	endbr32 
c010406c:	55                   	push   %ebp
c010406d:	89 e5                	mov    %esp,%ebp
c010406f:	83 ec 08             	sub    $0x8,%esp
    cprintf("write Virt Page c in fifo_check_swap\n");
c0104072:	83 ec 0c             	sub    $0xc,%esp
c0104075:	68 94 92 10 c0       	push   $0xc0109294
c010407a:	e8 2b c2 ff ff       	call   c01002aa <cprintf>
c010407f:	83 c4 10             	add    $0x10,%esp
    *(unsigned char *)0x3000 = 0x0c;
c0104082:	b8 00 30 00 00       	mov    $0x3000,%eax
c0104087:	c6 00 0c             	movb   $0xc,(%eax)
    assert(pgfault_num==4);
c010408a:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c010408f:	83 f8 04             	cmp    $0x4,%eax
c0104092:	74 16                	je     c01040aa <_fifo_check_swap+0x42>
c0104094:	68 ba 92 10 c0       	push   $0xc01092ba
c0104099:	68 3e 92 10 c0       	push   $0xc010923e
c010409e:	6a 51                	push   $0x51
c01040a0:	68 53 92 10 c0       	push   $0xc0109253
c01040a5:	e8 7b c3 ff ff       	call   c0100425 <__panic>
    cprintf("write Virt Page a in fifo_check_swap\n");
c01040aa:	83 ec 0c             	sub    $0xc,%esp
c01040ad:	68 cc 92 10 c0       	push   $0xc01092cc
c01040b2:	e8 f3 c1 ff ff       	call   c01002aa <cprintf>
c01040b7:	83 c4 10             	add    $0x10,%esp
    *(unsigned char *)0x1000 = 0x0a;
c01040ba:	b8 00 10 00 00       	mov    $0x1000,%eax
c01040bf:	c6 00 0a             	movb   $0xa,(%eax)
    assert(pgfault_num==4);
c01040c2:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c01040c7:	83 f8 04             	cmp    $0x4,%eax
c01040ca:	74 16                	je     c01040e2 <_fifo_check_swap+0x7a>
c01040cc:	68 ba 92 10 c0       	push   $0xc01092ba
c01040d1:	68 3e 92 10 c0       	push   $0xc010923e
c01040d6:	6a 54                	push   $0x54
c01040d8:	68 53 92 10 c0       	push   $0xc0109253
c01040dd:	e8 43 c3 ff ff       	call   c0100425 <__panic>
    cprintf("write Virt Page d in fifo_check_swap\n");
c01040e2:	83 ec 0c             	sub    $0xc,%esp
c01040e5:	68 f4 92 10 c0       	push   $0xc01092f4
c01040ea:	e8 bb c1 ff ff       	call   c01002aa <cprintf>
c01040ef:	83 c4 10             	add    $0x10,%esp
    *(unsigned char *)0x4000 = 0x0d;
c01040f2:	b8 00 40 00 00       	mov    $0x4000,%eax
c01040f7:	c6 00 0d             	movb   $0xd,(%eax)
    assert(pgfault_num==4);
c01040fa:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c01040ff:	83 f8 04             	cmp    $0x4,%eax
c0104102:	74 16                	je     c010411a <_fifo_check_swap+0xb2>
c0104104:	68 ba 92 10 c0       	push   $0xc01092ba
c0104109:	68 3e 92 10 c0       	push   $0xc010923e
c010410e:	6a 57                	push   $0x57
c0104110:	68 53 92 10 c0       	push   $0xc0109253
c0104115:	e8 0b c3 ff ff       	call   c0100425 <__panic>
    cprintf("write Virt Page b in fifo_check_swap\n");
c010411a:	83 ec 0c             	sub    $0xc,%esp
c010411d:	68 1c 93 10 c0       	push   $0xc010931c
c0104122:	e8 83 c1 ff ff       	call   c01002aa <cprintf>
c0104127:	83 c4 10             	add    $0x10,%esp
    *(unsigned char *)0x2000 = 0x0b;
c010412a:	b8 00 20 00 00       	mov    $0x2000,%eax
c010412f:	c6 00 0b             	movb   $0xb,(%eax)
    assert(pgfault_num==4);
c0104132:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c0104137:	83 f8 04             	cmp    $0x4,%eax
c010413a:	74 16                	je     c0104152 <_fifo_check_swap+0xea>
c010413c:	68 ba 92 10 c0       	push   $0xc01092ba
c0104141:	68 3e 92 10 c0       	push   $0xc010923e
c0104146:	6a 5a                	push   $0x5a
c0104148:	68 53 92 10 c0       	push   $0xc0109253
c010414d:	e8 d3 c2 ff ff       	call   c0100425 <__panic>
    cprintf("write Virt Page e in fifo_check_swap\n");
c0104152:	83 ec 0c             	sub    $0xc,%esp
c0104155:	68 44 93 10 c0       	push   $0xc0109344
c010415a:	e8 4b c1 ff ff       	call   c01002aa <cprintf>
c010415f:	83 c4 10             	add    $0x10,%esp
    *(unsigned char *)0x5000 = 0x0e;
c0104162:	b8 00 50 00 00       	mov    $0x5000,%eax
c0104167:	c6 00 0e             	movb   $0xe,(%eax)
    assert(pgfault_num==5);
c010416a:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c010416f:	83 f8 05             	cmp    $0x5,%eax
c0104172:	74 16                	je     c010418a <_fifo_check_swap+0x122>
c0104174:	68 6a 93 10 c0       	push   $0xc010936a
c0104179:	68 3e 92 10 c0       	push   $0xc010923e
c010417e:	6a 5d                	push   $0x5d
c0104180:	68 53 92 10 c0       	push   $0xc0109253
c0104185:	e8 9b c2 ff ff       	call   c0100425 <__panic>
    cprintf("write Virt Page b in fifo_check_swap\n");
c010418a:	83 ec 0c             	sub    $0xc,%esp
c010418d:	68 1c 93 10 c0       	push   $0xc010931c
c0104192:	e8 13 c1 ff ff       	call   c01002aa <cprintf>
c0104197:	83 c4 10             	add    $0x10,%esp
    *(unsigned char *)0x2000 = 0x0b;
c010419a:	b8 00 20 00 00       	mov    $0x2000,%eax
c010419f:	c6 00 0b             	movb   $0xb,(%eax)
    assert(pgfault_num==5);
c01041a2:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c01041a7:	83 f8 05             	cmp    $0x5,%eax
c01041aa:	74 16                	je     c01041c2 <_fifo_check_swap+0x15a>
c01041ac:	68 6a 93 10 c0       	push   $0xc010936a
c01041b1:	68 3e 92 10 c0       	push   $0xc010923e
c01041b6:	6a 60                	push   $0x60
c01041b8:	68 53 92 10 c0       	push   $0xc0109253
c01041bd:	e8 63 c2 ff ff       	call   c0100425 <__panic>
    cprintf("write Virt Page a in fifo_check_swap\n");
c01041c2:	83 ec 0c             	sub    $0xc,%esp
c01041c5:	68 cc 92 10 c0       	push   $0xc01092cc
c01041ca:	e8 db c0 ff ff       	call   c01002aa <cprintf>
c01041cf:	83 c4 10             	add    $0x10,%esp
    *(unsigned char *)0x1000 = 0x0a;
c01041d2:	b8 00 10 00 00       	mov    $0x1000,%eax
c01041d7:	c6 00 0a             	movb   $0xa,(%eax)
    assert(pgfault_num==6);
c01041da:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c01041df:	83 f8 06             	cmp    $0x6,%eax
c01041e2:	74 16                	je     c01041fa <_fifo_check_swap+0x192>
c01041e4:	68 79 93 10 c0       	push   $0xc0109379
c01041e9:	68 3e 92 10 c0       	push   $0xc010923e
c01041ee:	6a 63                	push   $0x63
c01041f0:	68 53 92 10 c0       	push   $0xc0109253
c01041f5:	e8 2b c2 ff ff       	call   c0100425 <__panic>
    cprintf("write Virt Page b in fifo_check_swap\n");
c01041fa:	83 ec 0c             	sub    $0xc,%esp
c01041fd:	68 1c 93 10 c0       	push   $0xc010931c
c0104202:	e8 a3 c0 ff ff       	call   c01002aa <cprintf>
c0104207:	83 c4 10             	add    $0x10,%esp
    *(unsigned char *)0x2000 = 0x0b;
c010420a:	b8 00 20 00 00       	mov    $0x2000,%eax
c010420f:	c6 00 0b             	movb   $0xb,(%eax)
    assert(pgfault_num==7);
c0104212:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c0104217:	83 f8 07             	cmp    $0x7,%eax
c010421a:	74 16                	je     c0104232 <_fifo_check_swap+0x1ca>
c010421c:	68 88 93 10 c0       	push   $0xc0109388
c0104221:	68 3e 92 10 c0       	push   $0xc010923e
c0104226:	6a 66                	push   $0x66
c0104228:	68 53 92 10 c0       	push   $0xc0109253
c010422d:	e8 f3 c1 ff ff       	call   c0100425 <__panic>
    cprintf("write Virt Page c in fifo_check_swap\n");
c0104232:	83 ec 0c             	sub    $0xc,%esp
c0104235:	68 94 92 10 c0       	push   $0xc0109294
c010423a:	e8 6b c0 ff ff       	call   c01002aa <cprintf>
c010423f:	83 c4 10             	add    $0x10,%esp
    *(unsigned char *)0x3000 = 0x0c;
c0104242:	b8 00 30 00 00       	mov    $0x3000,%eax
c0104247:	c6 00 0c             	movb   $0xc,(%eax)
    assert(pgfault_num==8);
c010424a:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c010424f:	83 f8 08             	cmp    $0x8,%eax
c0104252:	74 16                	je     c010426a <_fifo_check_swap+0x202>
c0104254:	68 97 93 10 c0       	push   $0xc0109397
c0104259:	68 3e 92 10 c0       	push   $0xc010923e
c010425e:	6a 69                	push   $0x69
c0104260:	68 53 92 10 c0       	push   $0xc0109253
c0104265:	e8 bb c1 ff ff       	call   c0100425 <__panic>
    cprintf("write Virt Page d in fifo_check_swap\n");
c010426a:	83 ec 0c             	sub    $0xc,%esp
c010426d:	68 f4 92 10 c0       	push   $0xc01092f4
c0104272:	e8 33 c0 ff ff       	call   c01002aa <cprintf>
c0104277:	83 c4 10             	add    $0x10,%esp
    *(unsigned char *)0x4000 = 0x0d;
c010427a:	b8 00 40 00 00       	mov    $0x4000,%eax
c010427f:	c6 00 0d             	movb   $0xd,(%eax)
    assert(pgfault_num==9);
c0104282:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c0104287:	83 f8 09             	cmp    $0x9,%eax
c010428a:	74 16                	je     c01042a2 <_fifo_check_swap+0x23a>
c010428c:	68 a6 93 10 c0       	push   $0xc01093a6
c0104291:	68 3e 92 10 c0       	push   $0xc010923e
c0104296:	6a 6c                	push   $0x6c
c0104298:	68 53 92 10 c0       	push   $0xc0109253
c010429d:	e8 83 c1 ff ff       	call   c0100425 <__panic>
    cprintf("write Virt Page e in fifo_check_swap\n");
c01042a2:	83 ec 0c             	sub    $0xc,%esp
c01042a5:	68 44 93 10 c0       	push   $0xc0109344
c01042aa:	e8 fb bf ff ff       	call   c01002aa <cprintf>
c01042af:	83 c4 10             	add    $0x10,%esp
    *(unsigned char *)0x5000 = 0x0e;
c01042b2:	b8 00 50 00 00       	mov    $0x5000,%eax
c01042b7:	c6 00 0e             	movb   $0xe,(%eax)
    assert(pgfault_num==10);
c01042ba:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c01042bf:	83 f8 0a             	cmp    $0xa,%eax
c01042c2:	74 16                	je     c01042da <_fifo_check_swap+0x272>
c01042c4:	68 b5 93 10 c0       	push   $0xc01093b5
c01042c9:	68 3e 92 10 c0       	push   $0xc010923e
c01042ce:	6a 6f                	push   $0x6f
c01042d0:	68 53 92 10 c0       	push   $0xc0109253
c01042d5:	e8 4b c1 ff ff       	call   c0100425 <__panic>
    cprintf("write Virt Page a in fifo_check_swap\n");
c01042da:	83 ec 0c             	sub    $0xc,%esp
c01042dd:	68 cc 92 10 c0       	push   $0xc01092cc
c01042e2:	e8 c3 bf ff ff       	call   c01002aa <cprintf>
c01042e7:	83 c4 10             	add    $0x10,%esp
    assert(*(unsigned char *)0x1000 == 0x0a);
c01042ea:	b8 00 10 00 00       	mov    $0x1000,%eax
c01042ef:	0f b6 00             	movzbl (%eax),%eax
c01042f2:	3c 0a                	cmp    $0xa,%al
c01042f4:	74 16                	je     c010430c <_fifo_check_swap+0x2a4>
c01042f6:	68 c8 93 10 c0       	push   $0xc01093c8
c01042fb:	68 3e 92 10 c0       	push   $0xc010923e
c0104300:	6a 71                	push   $0x71
c0104302:	68 53 92 10 c0       	push   $0xc0109253
c0104307:	e8 19 c1 ff ff       	call   c0100425 <__panic>
    *(unsigned char *)0x1000 = 0x0a;
c010430c:	b8 00 10 00 00       	mov    $0x1000,%eax
c0104311:	c6 00 0a             	movb   $0xa,(%eax)
    assert(pgfault_num==11);
c0104314:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c0104319:	83 f8 0b             	cmp    $0xb,%eax
c010431c:	74 16                	je     c0104334 <_fifo_check_swap+0x2cc>
c010431e:	68 e9 93 10 c0       	push   $0xc01093e9
c0104323:	68 3e 92 10 c0       	push   $0xc010923e
c0104328:	6a 73                	push   $0x73
c010432a:	68 53 92 10 c0       	push   $0xc0109253
c010432f:	e8 f1 c0 ff ff       	call   c0100425 <__panic>
    return 0;
c0104334:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0104339:	c9                   	leave  
c010433a:	c3                   	ret    

c010433b <_fifo_init>:


static int
_fifo_init(void)
{
c010433b:	f3 0f 1e fb          	endbr32 
c010433f:	55                   	push   %ebp
c0104340:	89 e5                	mov    %esp,%ebp
    return 0;
c0104342:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0104347:	5d                   	pop    %ebp
c0104348:	c3                   	ret    

c0104349 <_fifo_set_unswappable>:

static int
_fifo_set_unswappable(struct mm_struct *mm, uintptr_t addr)
{
c0104349:	f3 0f 1e fb          	endbr32 
c010434d:	55                   	push   %ebp
c010434e:	89 e5                	mov    %esp,%ebp
    return 0;
c0104350:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0104355:	5d                   	pop    %ebp
c0104356:	c3                   	ret    

c0104357 <_fifo_tick_event>:

static int
_fifo_tick_event(struct mm_struct *mm)
{ return 0; }
c0104357:	f3 0f 1e fb          	endbr32 
c010435b:	55                   	push   %ebp
c010435c:	89 e5                	mov    %esp,%ebp
c010435e:	b8 00 00 00 00       	mov    $0x0,%eax
c0104363:	5d                   	pop    %ebp
c0104364:	c3                   	ret    

c0104365 <pa2page>:
pa2page(uintptr_t pa) {
c0104365:	55                   	push   %ebp
c0104366:	89 e5                	mov    %esp,%ebp
c0104368:	83 ec 08             	sub    $0x8,%esp
    if (PPN(pa) >= npage) {
c010436b:	8b 45 08             	mov    0x8(%ebp),%eax
c010436e:	c1 e8 0c             	shr    $0xc,%eax
c0104371:	89 c2                	mov    %eax,%edx
c0104373:	a1 80 5f 12 c0       	mov    0xc0125f80,%eax
c0104378:	39 c2                	cmp    %eax,%edx
c010437a:	72 14                	jb     c0104390 <pa2page+0x2b>
        panic("pa2page called with invalid pa");
c010437c:	83 ec 04             	sub    $0x4,%esp
c010437f:	68 0c 94 10 c0       	push   $0xc010940c
c0104384:	6a 5b                	push   $0x5b
c0104386:	68 2b 94 10 c0       	push   $0xc010942b
c010438b:	e8 95 c0 ff ff       	call   c0100425 <__panic>
    return &pages[PPN(pa)];
c0104390:	a1 f8 60 12 c0       	mov    0xc01260f8,%eax
c0104395:	8b 55 08             	mov    0x8(%ebp),%edx
c0104398:	c1 ea 0c             	shr    $0xc,%edx
c010439b:	c1 e2 05             	shl    $0x5,%edx
c010439e:	01 d0                	add    %edx,%eax
}
c01043a0:	c9                   	leave  
c01043a1:	c3                   	ret    

c01043a2 <pte2page>:
pte2page(pte_t pte) {
c01043a2:	55                   	push   %ebp
c01043a3:	89 e5                	mov    %esp,%ebp
c01043a5:	83 ec 08             	sub    $0x8,%esp
    if (!(pte & PTE_P)) {
c01043a8:	8b 45 08             	mov    0x8(%ebp),%eax
c01043ab:	83 e0 01             	and    $0x1,%eax
c01043ae:	85 c0                	test   %eax,%eax
c01043b0:	75 14                	jne    c01043c6 <pte2page+0x24>
        panic("pte2page called with invalid pte");
c01043b2:	83 ec 04             	sub    $0x4,%esp
c01043b5:	68 3c 94 10 c0       	push   $0xc010943c
c01043ba:	6a 6d                	push   $0x6d
c01043bc:	68 2b 94 10 c0       	push   $0xc010942b
c01043c1:	e8 5f c0 ff ff       	call   c0100425 <__panic>
    return pa2page(PTE_ADDR(pte));
c01043c6:	8b 45 08             	mov    0x8(%ebp),%eax
c01043c9:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c01043ce:	83 ec 0c             	sub    $0xc,%esp
c01043d1:	50                   	push   %eax
c01043d2:	e8 8e ff ff ff       	call   c0104365 <pa2page>
c01043d7:	83 c4 10             	add    $0x10,%esp
}
c01043da:	c9                   	leave  
c01043db:	c3                   	ret    

c01043dc <swap_init>:

static void check_swap(void);

int
swap_init(void)
{
c01043dc:	f3 0f 1e fb          	endbr32 
c01043e0:	55                   	push   %ebp
c01043e1:	89 e5                	mov    %esp,%ebp
c01043e3:	83 ec 18             	sub    $0x18,%esp
     swapfs_init();
c01043e6:	e8 94 33 00 00       	call   c010777f <swapfs_init>

     if (!(1024 <= max_swap_offset && max_swap_offset < MAX_SWAP_OFFSET_LIMIT))
c01043eb:	a1 bc 60 12 c0       	mov    0xc01260bc,%eax
c01043f0:	3d ff 03 00 00       	cmp    $0x3ff,%eax
c01043f5:	76 0c                	jbe    c0104403 <swap_init+0x27>
c01043f7:	a1 bc 60 12 c0       	mov    0xc01260bc,%eax
c01043fc:	3d ff ff ff 00       	cmp    $0xffffff,%eax
c0104401:	76 17                	jbe    c010441a <swap_init+0x3e>
     {
          panic("bad max_swap_offset %08x.\n", max_swap_offset);
c0104403:	a1 bc 60 12 c0       	mov    0xc01260bc,%eax
c0104408:	50                   	push   %eax
c0104409:	68 5d 94 10 c0       	push   $0xc010945d
c010440e:	6a 25                	push   $0x25
c0104410:	68 78 94 10 c0       	push   $0xc0109478
c0104415:	e8 0b c0 ff ff       	call   c0100425 <__panic>
     }
     

     sm = &swap_manager_fifo;
c010441a:	c7 05 70 5f 12 c0 e0 	movl   $0xc01229e0,0xc0125f70
c0104421:	29 12 c0 
     int r = sm->init();
c0104424:	a1 70 5f 12 c0       	mov    0xc0125f70,%eax
c0104429:	8b 40 04             	mov    0x4(%eax),%eax
c010442c:	ff d0                	call   *%eax
c010442e:	89 45 f4             	mov    %eax,-0xc(%ebp)
     
     if (r == 0)
c0104431:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0104435:	75 27                	jne    c010445e <swap_init+0x82>
     {
          swap_init_ok = 1;
c0104437:	c7 05 68 5f 12 c0 01 	movl   $0x1,0xc0125f68
c010443e:	00 00 00 
          cprintf("SWAP: manager = %s\n", sm->name);
c0104441:	a1 70 5f 12 c0       	mov    0xc0125f70,%eax
c0104446:	8b 00                	mov    (%eax),%eax
c0104448:	83 ec 08             	sub    $0x8,%esp
c010444b:	50                   	push   %eax
c010444c:	68 87 94 10 c0       	push   $0xc0109487
c0104451:	e8 54 be ff ff       	call   c01002aa <cprintf>
c0104456:	83 c4 10             	add    $0x10,%esp
          check_swap();
c0104459:	e8 0f 04 00 00       	call   c010486d <check_swap>
     }

     return r;
c010445e:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0104461:	c9                   	leave  
c0104462:	c3                   	ret    

c0104463 <swap_init_mm>:

int
swap_init_mm(struct mm_struct *mm)
{
c0104463:	f3 0f 1e fb          	endbr32 
c0104467:	55                   	push   %ebp
c0104468:	89 e5                	mov    %esp,%ebp
c010446a:	83 ec 08             	sub    $0x8,%esp
     return sm->init_mm(mm);
c010446d:	a1 70 5f 12 c0       	mov    0xc0125f70,%eax
c0104472:	8b 40 08             	mov    0x8(%eax),%eax
c0104475:	83 ec 0c             	sub    $0xc,%esp
c0104478:	ff 75 08             	pushl  0x8(%ebp)
c010447b:	ff d0                	call   *%eax
c010447d:	83 c4 10             	add    $0x10,%esp
}
c0104480:	c9                   	leave  
c0104481:	c3                   	ret    

c0104482 <swap_tick_event>:

int
swap_tick_event(struct mm_struct *mm)
{
c0104482:	f3 0f 1e fb          	endbr32 
c0104486:	55                   	push   %ebp
c0104487:	89 e5                	mov    %esp,%ebp
c0104489:	83 ec 08             	sub    $0x8,%esp
     return sm->tick_event(mm);
c010448c:	a1 70 5f 12 c0       	mov    0xc0125f70,%eax
c0104491:	8b 40 0c             	mov    0xc(%eax),%eax
c0104494:	83 ec 0c             	sub    $0xc,%esp
c0104497:	ff 75 08             	pushl  0x8(%ebp)
c010449a:	ff d0                	call   *%eax
c010449c:	83 c4 10             	add    $0x10,%esp
}
c010449f:	c9                   	leave  
c01044a0:	c3                   	ret    

c01044a1 <swap_map_swappable>:

int
swap_map_swappable(struct mm_struct *mm, uintptr_t addr, struct Page *page, int swap_in)
{
c01044a1:	f3 0f 1e fb          	endbr32 
c01044a5:	55                   	push   %ebp
c01044a6:	89 e5                	mov    %esp,%ebp
c01044a8:	83 ec 08             	sub    $0x8,%esp
     return sm->map_swappable(mm, addr, page, swap_in);
c01044ab:	a1 70 5f 12 c0       	mov    0xc0125f70,%eax
c01044b0:	8b 40 10             	mov    0x10(%eax),%eax
c01044b3:	ff 75 14             	pushl  0x14(%ebp)
c01044b6:	ff 75 10             	pushl  0x10(%ebp)
c01044b9:	ff 75 0c             	pushl  0xc(%ebp)
c01044bc:	ff 75 08             	pushl  0x8(%ebp)
c01044bf:	ff d0                	call   *%eax
c01044c1:	83 c4 10             	add    $0x10,%esp
}
c01044c4:	c9                   	leave  
c01044c5:	c3                   	ret    

c01044c6 <swap_set_unswappable>:

int
swap_set_unswappable(struct mm_struct *mm, uintptr_t addr)
{
c01044c6:	f3 0f 1e fb          	endbr32 
c01044ca:	55                   	push   %ebp
c01044cb:	89 e5                	mov    %esp,%ebp
c01044cd:	83 ec 08             	sub    $0x8,%esp
     return sm->set_unswappable(mm, addr);
c01044d0:	a1 70 5f 12 c0       	mov    0xc0125f70,%eax
c01044d5:	8b 40 14             	mov    0x14(%eax),%eax
c01044d8:	83 ec 08             	sub    $0x8,%esp
c01044db:	ff 75 0c             	pushl  0xc(%ebp)
c01044de:	ff 75 08             	pushl  0x8(%ebp)
c01044e1:	ff d0                	call   *%eax
c01044e3:	83 c4 10             	add    $0x10,%esp
}
c01044e6:	c9                   	leave  
c01044e7:	c3                   	ret    

c01044e8 <swap_out>:

volatile unsigned int swap_out_num=0;

int
swap_out(struct mm_struct *mm, int n, int in_tick)
{
c01044e8:	f3 0f 1e fb          	endbr32 
c01044ec:	55                   	push   %ebp
c01044ed:	89 e5                	mov    %esp,%ebp
c01044ef:	83 ec 28             	sub    $0x28,%esp
     int i;
     for (i = 0; i != n; ++ i)
c01044f2:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c01044f9:	e9 2e 01 00 00       	jmp    c010462c <swap_out+0x144>
     {
          uintptr_t v;
          //struct Page **ptr_page=NULL;
          struct Page *page;
          // cprintf("i %d, SWAP: call swap_out_victim\n",i);
          int r = sm->swap_out_victim(mm, &page, in_tick);
c01044fe:	a1 70 5f 12 c0       	mov    0xc0125f70,%eax
c0104503:	8b 40 18             	mov    0x18(%eax),%eax
c0104506:	83 ec 04             	sub    $0x4,%esp
c0104509:	ff 75 10             	pushl  0x10(%ebp)
c010450c:	8d 55 e4             	lea    -0x1c(%ebp),%edx
c010450f:	52                   	push   %edx
c0104510:	ff 75 08             	pushl  0x8(%ebp)
c0104513:	ff d0                	call   *%eax
c0104515:	83 c4 10             	add    $0x10,%esp
c0104518:	89 45 f0             	mov    %eax,-0x10(%ebp)
          if (r != 0) {
c010451b:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c010451f:	74 18                	je     c0104539 <swap_out+0x51>
                    cprintf("i %d, swap_out: call swap_out_victim failed\n",i);
c0104521:	83 ec 08             	sub    $0x8,%esp
c0104524:	ff 75 f4             	pushl  -0xc(%ebp)
c0104527:	68 9c 94 10 c0       	push   $0xc010949c
c010452c:	e8 79 bd ff ff       	call   c01002aa <cprintf>
c0104531:	83 c4 10             	add    $0x10,%esp
c0104534:	e9 ff 00 00 00       	jmp    c0104638 <swap_out+0x150>
          }          
          //assert(!PageReserved(page));

          //cprintf("SWAP: choose victim page 0x%08x\n", page);
          
          v=page->pra_vaddr; 
c0104539:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010453c:	8b 40 1c             	mov    0x1c(%eax),%eax
c010453f:	89 45 ec             	mov    %eax,-0x14(%ebp)
          pte_t *ptep = get_pte(mm->pgdir, v, 0);
c0104542:	8b 45 08             	mov    0x8(%ebp),%eax
c0104545:	8b 40 0c             	mov    0xc(%eax),%eax
c0104548:	83 ec 04             	sub    $0x4,%esp
c010454b:	6a 00                	push   $0x0
c010454d:	ff 75 ec             	pushl  -0x14(%ebp)
c0104550:	50                   	push   %eax
c0104551:	e8 5a 23 00 00       	call   c01068b0 <get_pte>
c0104556:	83 c4 10             	add    $0x10,%esp
c0104559:	89 45 e8             	mov    %eax,-0x18(%ebp)
          assert((*ptep & PTE_P) != 0);
c010455c:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010455f:	8b 00                	mov    (%eax),%eax
c0104561:	83 e0 01             	and    $0x1,%eax
c0104564:	85 c0                	test   %eax,%eax
c0104566:	75 16                	jne    c010457e <swap_out+0x96>
c0104568:	68 c9 94 10 c0       	push   $0xc01094c9
c010456d:	68 de 94 10 c0       	push   $0xc01094de
c0104572:	6a 65                	push   $0x65
c0104574:	68 78 94 10 c0       	push   $0xc0109478
c0104579:	e8 a7 be ff ff       	call   c0100425 <__panic>

          if (swapfs_write( (page->pra_vaddr/PGSIZE+1)<<8, page) != 0) {
c010457e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104581:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0104584:	8b 52 1c             	mov    0x1c(%edx),%edx
c0104587:	c1 ea 0c             	shr    $0xc,%edx
c010458a:	83 c2 01             	add    $0x1,%edx
c010458d:	c1 e2 08             	shl    $0x8,%edx
c0104590:	83 ec 08             	sub    $0x8,%esp
c0104593:	50                   	push   %eax
c0104594:	52                   	push   %edx
c0104595:	e8 88 32 00 00       	call   c0107822 <swapfs_write>
c010459a:	83 c4 10             	add    $0x10,%esp
c010459d:	85 c0                	test   %eax,%eax
c010459f:	74 2b                	je     c01045cc <swap_out+0xe4>
                    cprintf("SWAP: failed to save\n");
c01045a1:	83 ec 0c             	sub    $0xc,%esp
c01045a4:	68 f3 94 10 c0       	push   $0xc01094f3
c01045a9:	e8 fc bc ff ff       	call   c01002aa <cprintf>
c01045ae:	83 c4 10             	add    $0x10,%esp
                    sm->map_swappable(mm, v, page, 0);
c01045b1:	a1 70 5f 12 c0       	mov    0xc0125f70,%eax
c01045b6:	8b 40 10             	mov    0x10(%eax),%eax
c01045b9:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c01045bc:	6a 00                	push   $0x0
c01045be:	52                   	push   %edx
c01045bf:	ff 75 ec             	pushl  -0x14(%ebp)
c01045c2:	ff 75 08             	pushl  0x8(%ebp)
c01045c5:	ff d0                	call   *%eax
c01045c7:	83 c4 10             	add    $0x10,%esp
c01045ca:	eb 5c                	jmp    c0104628 <swap_out+0x140>
                    continue;
          }
          else {
                    cprintf("swap_out: i %d, store page in vaddr 0x%x to disk swap entry %d\n", i, v, page->pra_vaddr/PGSIZE+1);
c01045cc:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01045cf:	8b 40 1c             	mov    0x1c(%eax),%eax
c01045d2:	c1 e8 0c             	shr    $0xc,%eax
c01045d5:	83 c0 01             	add    $0x1,%eax
c01045d8:	50                   	push   %eax
c01045d9:	ff 75 ec             	pushl  -0x14(%ebp)
c01045dc:	ff 75 f4             	pushl  -0xc(%ebp)
c01045df:	68 0c 95 10 c0       	push   $0xc010950c
c01045e4:	e8 c1 bc ff ff       	call   c01002aa <cprintf>
c01045e9:	83 c4 10             	add    $0x10,%esp
                    *ptep = (page->pra_vaddr/PGSIZE+1)<<8;
c01045ec:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01045ef:	8b 40 1c             	mov    0x1c(%eax),%eax
c01045f2:	c1 e8 0c             	shr    $0xc,%eax
c01045f5:	83 c0 01             	add    $0x1,%eax
c01045f8:	c1 e0 08             	shl    $0x8,%eax
c01045fb:	89 c2                	mov    %eax,%edx
c01045fd:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0104600:	89 10                	mov    %edx,(%eax)
                    free_page(page);
c0104602:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104605:	83 ec 08             	sub    $0x8,%esp
c0104608:	6a 01                	push   $0x1
c010460a:	50                   	push   %eax
c010460b:	e8 ab 1c 00 00       	call   c01062bb <free_pages>
c0104610:	83 c4 10             	add    $0x10,%esp
          }
          
          tlb_invalidate(mm->pgdir, v);
c0104613:	8b 45 08             	mov    0x8(%ebp),%eax
c0104616:	8b 40 0c             	mov    0xc(%eax),%eax
c0104619:	83 ec 08             	sub    $0x8,%esp
c010461c:	ff 75 ec             	pushl  -0x14(%ebp)
c010461f:	50                   	push   %eax
c0104620:	e8 e0 23 00 00       	call   c0106a05 <tlb_invalidate>
c0104625:	83 c4 10             	add    $0x10,%esp
     for (i = 0; i != n; ++ i)
c0104628:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c010462c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010462f:	3b 45 0c             	cmp    0xc(%ebp),%eax
c0104632:	0f 85 c6 fe ff ff    	jne    c01044fe <swap_out+0x16>
     }
     return i;
c0104638:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c010463b:	c9                   	leave  
c010463c:	c3                   	ret    

c010463d <swap_in>:

int
swap_in(struct mm_struct *mm, uintptr_t addr, struct Page **ptr_result)
{
c010463d:	f3 0f 1e fb          	endbr32 
c0104641:	55                   	push   %ebp
c0104642:	89 e5                	mov    %esp,%ebp
c0104644:	83 ec 18             	sub    $0x18,%esp
     struct Page *result = alloc_page();
c0104647:	83 ec 0c             	sub    $0xc,%esp
c010464a:	6a 01                	push   $0x1
c010464c:	e8 fa 1b 00 00       	call   c010624b <alloc_pages>
c0104651:	83 c4 10             	add    $0x10,%esp
c0104654:	89 45 f4             	mov    %eax,-0xc(%ebp)
     assert(result!=NULL);
c0104657:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c010465b:	75 16                	jne    c0104673 <swap_in+0x36>
c010465d:	68 4c 95 10 c0       	push   $0xc010954c
c0104662:	68 de 94 10 c0       	push   $0xc01094de
c0104667:	6a 7b                	push   $0x7b
c0104669:	68 78 94 10 c0       	push   $0xc0109478
c010466e:	e8 b2 bd ff ff       	call   c0100425 <__panic>

     pte_t *ptep = get_pte(mm->pgdir, addr, 0);
c0104673:	8b 45 08             	mov    0x8(%ebp),%eax
c0104676:	8b 40 0c             	mov    0xc(%eax),%eax
c0104679:	83 ec 04             	sub    $0x4,%esp
c010467c:	6a 00                	push   $0x0
c010467e:	ff 75 0c             	pushl  0xc(%ebp)
c0104681:	50                   	push   %eax
c0104682:	e8 29 22 00 00       	call   c01068b0 <get_pte>
c0104687:	83 c4 10             	add    $0x10,%esp
c010468a:	89 45 f0             	mov    %eax,-0x10(%ebp)
     // cprintf("SWAP: load ptep %x swap entry %d to vaddr 0x%08x, page %x, No %d\n", ptep, (*ptep)>>8, addr, result, (result-pages));
    
     int r;
     if ((r = swapfs_read((*ptep), result)) != 0)
c010468d:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104690:	8b 00                	mov    (%eax),%eax
c0104692:	83 ec 08             	sub    $0x8,%esp
c0104695:	ff 75 f4             	pushl  -0xc(%ebp)
c0104698:	50                   	push   %eax
c0104699:	e8 28 31 00 00       	call   c01077c6 <swapfs_read>
c010469e:	83 c4 10             	add    $0x10,%esp
c01046a1:	89 45 ec             	mov    %eax,-0x14(%ebp)
c01046a4:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c01046a8:	74 1f                	je     c01046c9 <swap_in+0x8c>
     {
        assert(r!=0);
c01046aa:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c01046ae:	75 19                	jne    c01046c9 <swap_in+0x8c>
c01046b0:	68 59 95 10 c0       	push   $0xc0109559
c01046b5:	68 de 94 10 c0       	push   $0xc01094de
c01046ba:	68 83 00 00 00       	push   $0x83
c01046bf:	68 78 94 10 c0       	push   $0xc0109478
c01046c4:	e8 5c bd ff ff       	call   c0100425 <__panic>
     }
     cprintf("swap_in: load disk swap entry %d with swap_page in vadr 0x%x\n", (*ptep)>>8, addr);
c01046c9:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01046cc:	8b 00                	mov    (%eax),%eax
c01046ce:	c1 e8 08             	shr    $0x8,%eax
c01046d1:	83 ec 04             	sub    $0x4,%esp
c01046d4:	ff 75 0c             	pushl  0xc(%ebp)
c01046d7:	50                   	push   %eax
c01046d8:	68 60 95 10 c0       	push   $0xc0109560
c01046dd:	e8 c8 bb ff ff       	call   c01002aa <cprintf>
c01046e2:	83 c4 10             	add    $0x10,%esp
     *ptr_result=result;
c01046e5:	8b 45 10             	mov    0x10(%ebp),%eax
c01046e8:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01046eb:	89 10                	mov    %edx,(%eax)
     return 0;
c01046ed:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01046f2:	c9                   	leave  
c01046f3:	c3                   	ret    

c01046f4 <check_content_set>:



static inline void
check_content_set(void)
{
c01046f4:	55                   	push   %ebp
c01046f5:	89 e5                	mov    %esp,%ebp
c01046f7:	83 ec 08             	sub    $0x8,%esp
     *(unsigned char *)0x1000 = 0x0a;
c01046fa:	b8 00 10 00 00       	mov    $0x1000,%eax
c01046ff:	c6 00 0a             	movb   $0xa,(%eax)
     assert(pgfault_num==1);
c0104702:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c0104707:	83 f8 01             	cmp    $0x1,%eax
c010470a:	74 19                	je     c0104725 <check_content_set+0x31>
c010470c:	68 9e 95 10 c0       	push   $0xc010959e
c0104711:	68 de 94 10 c0       	push   $0xc01094de
c0104716:	68 90 00 00 00       	push   $0x90
c010471b:	68 78 94 10 c0       	push   $0xc0109478
c0104720:	e8 00 bd ff ff       	call   c0100425 <__panic>
     *(unsigned char *)0x1010 = 0x0a;
c0104725:	b8 10 10 00 00       	mov    $0x1010,%eax
c010472a:	c6 00 0a             	movb   $0xa,(%eax)
     assert(pgfault_num==1);
c010472d:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c0104732:	83 f8 01             	cmp    $0x1,%eax
c0104735:	74 19                	je     c0104750 <check_content_set+0x5c>
c0104737:	68 9e 95 10 c0       	push   $0xc010959e
c010473c:	68 de 94 10 c0       	push   $0xc01094de
c0104741:	68 92 00 00 00       	push   $0x92
c0104746:	68 78 94 10 c0       	push   $0xc0109478
c010474b:	e8 d5 bc ff ff       	call   c0100425 <__panic>
     *(unsigned char *)0x2000 = 0x0b;
c0104750:	b8 00 20 00 00       	mov    $0x2000,%eax
c0104755:	c6 00 0b             	movb   $0xb,(%eax)
     assert(pgfault_num==2);
c0104758:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c010475d:	83 f8 02             	cmp    $0x2,%eax
c0104760:	74 19                	je     c010477b <check_content_set+0x87>
c0104762:	68 ad 95 10 c0       	push   $0xc01095ad
c0104767:	68 de 94 10 c0       	push   $0xc01094de
c010476c:	68 94 00 00 00       	push   $0x94
c0104771:	68 78 94 10 c0       	push   $0xc0109478
c0104776:	e8 aa bc ff ff       	call   c0100425 <__panic>
     *(unsigned char *)0x2010 = 0x0b;
c010477b:	b8 10 20 00 00       	mov    $0x2010,%eax
c0104780:	c6 00 0b             	movb   $0xb,(%eax)
     assert(pgfault_num==2);
c0104783:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c0104788:	83 f8 02             	cmp    $0x2,%eax
c010478b:	74 19                	je     c01047a6 <check_content_set+0xb2>
c010478d:	68 ad 95 10 c0       	push   $0xc01095ad
c0104792:	68 de 94 10 c0       	push   $0xc01094de
c0104797:	68 96 00 00 00       	push   $0x96
c010479c:	68 78 94 10 c0       	push   $0xc0109478
c01047a1:	e8 7f bc ff ff       	call   c0100425 <__panic>
     *(unsigned char *)0x3000 = 0x0c;
c01047a6:	b8 00 30 00 00       	mov    $0x3000,%eax
c01047ab:	c6 00 0c             	movb   $0xc,(%eax)
     assert(pgfault_num==3);
c01047ae:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c01047b3:	83 f8 03             	cmp    $0x3,%eax
c01047b6:	74 19                	je     c01047d1 <check_content_set+0xdd>
c01047b8:	68 bc 95 10 c0       	push   $0xc01095bc
c01047bd:	68 de 94 10 c0       	push   $0xc01094de
c01047c2:	68 98 00 00 00       	push   $0x98
c01047c7:	68 78 94 10 c0       	push   $0xc0109478
c01047cc:	e8 54 bc ff ff       	call   c0100425 <__panic>
     *(unsigned char *)0x3010 = 0x0c;
c01047d1:	b8 10 30 00 00       	mov    $0x3010,%eax
c01047d6:	c6 00 0c             	movb   $0xc,(%eax)
     assert(pgfault_num==3);
c01047d9:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c01047de:	83 f8 03             	cmp    $0x3,%eax
c01047e1:	74 19                	je     c01047fc <check_content_set+0x108>
c01047e3:	68 bc 95 10 c0       	push   $0xc01095bc
c01047e8:	68 de 94 10 c0       	push   $0xc01094de
c01047ed:	68 9a 00 00 00       	push   $0x9a
c01047f2:	68 78 94 10 c0       	push   $0xc0109478
c01047f7:	e8 29 bc ff ff       	call   c0100425 <__panic>
     *(unsigned char *)0x4000 = 0x0d;
c01047fc:	b8 00 40 00 00       	mov    $0x4000,%eax
c0104801:	c6 00 0d             	movb   $0xd,(%eax)
     assert(pgfault_num==4);
c0104804:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c0104809:	83 f8 04             	cmp    $0x4,%eax
c010480c:	74 19                	je     c0104827 <check_content_set+0x133>
c010480e:	68 cb 95 10 c0       	push   $0xc01095cb
c0104813:	68 de 94 10 c0       	push   $0xc01094de
c0104818:	68 9c 00 00 00       	push   $0x9c
c010481d:	68 78 94 10 c0       	push   $0xc0109478
c0104822:	e8 fe bb ff ff       	call   c0100425 <__panic>
     *(unsigned char *)0x4010 = 0x0d;
c0104827:	b8 10 40 00 00       	mov    $0x4010,%eax
c010482c:	c6 00 0d             	movb   $0xd,(%eax)
     assert(pgfault_num==4);
c010482f:	a1 64 5f 12 c0       	mov    0xc0125f64,%eax
c0104834:	83 f8 04             	cmp    $0x4,%eax
c0104837:	74 19                	je     c0104852 <check_content_set+0x15e>
c0104839:	68 cb 95 10 c0       	push   $0xc01095cb
c010483e:	68 de 94 10 c0       	push   $0xc01094de
c0104843:	68 9e 00 00 00       	push   $0x9e
c0104848:	68 78 94 10 c0       	push   $0xc0109478
c010484d:	e8 d3 bb ff ff       	call   c0100425 <__panic>
}
c0104852:	90                   	nop
c0104853:	c9                   	leave  
c0104854:	c3                   	ret    

c0104855 <check_content_access>:

static inline int
check_content_access(void)
{
c0104855:	55                   	push   %ebp
c0104856:	89 e5                	mov    %esp,%ebp
c0104858:	83 ec 18             	sub    $0x18,%esp
    int ret = sm->check_swap();
c010485b:	a1 70 5f 12 c0       	mov    0xc0125f70,%eax
c0104860:	8b 40 1c             	mov    0x1c(%eax),%eax
c0104863:	ff d0                	call   *%eax
c0104865:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return ret;
c0104868:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c010486b:	c9                   	leave  
c010486c:	c3                   	ret    

c010486d <check_swap>:
#define free_list (free_area.free_list)
#define nr_free (free_area.nr_free)

static void
check_swap(void)
{
c010486d:	f3 0f 1e fb          	endbr32 
c0104871:	55                   	push   %ebp
c0104872:	89 e5                	mov    %esp,%ebp
c0104874:	83 ec 68             	sub    $0x68,%esp
    //backup mem env
     int ret, count = 0, total = 0, i;
c0104877:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c010487e:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
     list_entry_t *le = &free_list;
c0104885:	c7 45 e8 e4 60 12 c0 	movl   $0xc01260e4,-0x18(%ebp)
     while ((le = list_next(le)) != &free_list) {
c010488c:	eb 60                	jmp    c01048ee <check_swap+0x81>
        struct Page *p = le2page(le, page_link);
c010488e:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0104891:	83 e8 0c             	sub    $0xc,%eax
c0104894:	89 45 c8             	mov    %eax,-0x38(%ebp)
        assert(PageProperty(p));
c0104897:	8b 45 c8             	mov    -0x38(%ebp),%eax
c010489a:	83 c0 04             	add    $0x4,%eax
c010489d:	c7 45 c4 01 00 00 00 	movl   $0x1,-0x3c(%ebp)
c01048a4:	89 45 c0             	mov    %eax,-0x40(%ebp)
 * @addr:   the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
    int oldbit;
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c01048a7:	8b 45 c0             	mov    -0x40(%ebp),%eax
c01048aa:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c01048ad:	0f a3 10             	bt     %edx,(%eax)
c01048b0:	19 c0                	sbb    %eax,%eax
c01048b2:	89 45 bc             	mov    %eax,-0x44(%ebp)
    return oldbit != 0;
c01048b5:	83 7d bc 00          	cmpl   $0x0,-0x44(%ebp)
c01048b9:	0f 95 c0             	setne  %al
c01048bc:	0f b6 c0             	movzbl %al,%eax
c01048bf:	85 c0                	test   %eax,%eax
c01048c1:	75 19                	jne    c01048dc <check_swap+0x6f>
c01048c3:	68 da 95 10 c0       	push   $0xc01095da
c01048c8:	68 de 94 10 c0       	push   $0xc01094de
c01048cd:	68 b9 00 00 00       	push   $0xb9
c01048d2:	68 78 94 10 c0       	push   $0xc0109478
c01048d7:	e8 49 bb ff ff       	call   c0100425 <__panic>
        count ++, total += p->property;
c01048dc:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c01048e0:	8b 45 c8             	mov    -0x38(%ebp),%eax
c01048e3:	8b 50 08             	mov    0x8(%eax),%edx
c01048e6:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01048e9:	01 d0                	add    %edx,%eax
c01048eb:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01048ee:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01048f1:	89 45 b8             	mov    %eax,-0x48(%ebp)
    return listelm->next;
c01048f4:	8b 45 b8             	mov    -0x48(%ebp),%eax
c01048f7:	8b 40 04             	mov    0x4(%eax),%eax
     while ((le = list_next(le)) != &free_list) {
c01048fa:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01048fd:	81 7d e8 e4 60 12 c0 	cmpl   $0xc01260e4,-0x18(%ebp)
c0104904:	75 88                	jne    c010488e <check_swap+0x21>
     }
     assert(total == nr_free_pages());
c0104906:	e8 e9 19 00 00       	call   c01062f4 <nr_free_pages>
c010490b:	8b 55 f0             	mov    -0x10(%ebp),%edx
c010490e:	39 d0                	cmp    %edx,%eax
c0104910:	74 19                	je     c010492b <check_swap+0xbe>
c0104912:	68 ea 95 10 c0       	push   $0xc01095ea
c0104917:	68 de 94 10 c0       	push   $0xc01094de
c010491c:	68 bc 00 00 00       	push   $0xbc
c0104921:	68 78 94 10 c0       	push   $0xc0109478
c0104926:	e8 fa ba ff ff       	call   c0100425 <__panic>
     cprintf("BEGIN check_swap: count %d, total %d\n",count,total);
c010492b:	83 ec 04             	sub    $0x4,%esp
c010492e:	ff 75 f0             	pushl  -0x10(%ebp)
c0104931:	ff 75 f4             	pushl  -0xc(%ebp)
c0104934:	68 04 96 10 c0       	push   $0xc0109604
c0104939:	e8 6c b9 ff ff       	call   c01002aa <cprintf>
c010493e:	83 c4 10             	add    $0x10,%esp
     
     //now we set the phy pages env     
     struct mm_struct *mm = mm_create();
c0104941:	e8 51 e9 ff ff       	call   c0103297 <mm_create>
c0104946:	89 45 e4             	mov    %eax,-0x1c(%ebp)
     assert(mm != NULL);
c0104949:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c010494d:	75 19                	jne    c0104968 <check_swap+0xfb>
c010494f:	68 2a 96 10 c0       	push   $0xc010962a
c0104954:	68 de 94 10 c0       	push   $0xc01094de
c0104959:	68 c1 00 00 00       	push   $0xc1
c010495e:	68 78 94 10 c0       	push   $0xc0109478
c0104963:	e8 bd ba ff ff       	call   c0100425 <__panic>

     extern struct mm_struct *check_mm_struct;
     assert(check_mm_struct == NULL);
c0104968:	a1 10 60 12 c0       	mov    0xc0126010,%eax
c010496d:	85 c0                	test   %eax,%eax
c010496f:	74 19                	je     c010498a <check_swap+0x11d>
c0104971:	68 35 96 10 c0       	push   $0xc0109635
c0104976:	68 de 94 10 c0       	push   $0xc01094de
c010497b:	68 c4 00 00 00       	push   $0xc4
c0104980:	68 78 94 10 c0       	push   $0xc0109478
c0104985:	e8 9b ba ff ff       	call   c0100425 <__panic>

     check_mm_struct = mm;
c010498a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010498d:	a3 10 60 12 c0       	mov    %eax,0xc0126010

     pde_t *pgdir = mm->pgdir = boot_pgdir;
c0104992:	8b 15 00 2a 12 c0    	mov    0xc0122a00,%edx
c0104998:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010499b:	89 50 0c             	mov    %edx,0xc(%eax)
c010499e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01049a1:	8b 40 0c             	mov    0xc(%eax),%eax
c01049a4:	89 45 e0             	mov    %eax,-0x20(%ebp)
     assert(pgdir[0] == 0);
c01049a7:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01049aa:	8b 00                	mov    (%eax),%eax
c01049ac:	85 c0                	test   %eax,%eax
c01049ae:	74 19                	je     c01049c9 <check_swap+0x15c>
c01049b0:	68 4d 96 10 c0       	push   $0xc010964d
c01049b5:	68 de 94 10 c0       	push   $0xc01094de
c01049ba:	68 c9 00 00 00       	push   $0xc9
c01049bf:	68 78 94 10 c0       	push   $0xc0109478
c01049c4:	e8 5c ba ff ff       	call   c0100425 <__panic>

     struct vma_struct *vma = vma_create(BEING_CHECK_VALID_VADDR, CHECK_VALID_VADDR, VM_WRITE | VM_READ);
c01049c9:	83 ec 04             	sub    $0x4,%esp
c01049cc:	6a 03                	push   $0x3
c01049ce:	68 00 60 00 00       	push   $0x6000
c01049d3:	68 00 10 00 00       	push   $0x1000
c01049d8:	e8 3b e9 ff ff       	call   c0103318 <vma_create>
c01049dd:	83 c4 10             	add    $0x10,%esp
c01049e0:	89 45 dc             	mov    %eax,-0x24(%ebp)
     assert(vma != NULL);
c01049e3:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
c01049e7:	75 19                	jne    c0104a02 <check_swap+0x195>
c01049e9:	68 5b 96 10 c0       	push   $0xc010965b
c01049ee:	68 de 94 10 c0       	push   $0xc01094de
c01049f3:	68 cc 00 00 00       	push   $0xcc
c01049f8:	68 78 94 10 c0       	push   $0xc0109478
c01049fd:	e8 23 ba ff ff       	call   c0100425 <__panic>

     insert_vma_struct(mm, vma);
c0104a02:	83 ec 08             	sub    $0x8,%esp
c0104a05:	ff 75 dc             	pushl  -0x24(%ebp)
c0104a08:	ff 75 e4             	pushl  -0x1c(%ebp)
c0104a0b:	e8 78 ea ff ff       	call   c0103488 <insert_vma_struct>
c0104a10:	83 c4 10             	add    $0x10,%esp

     //setup the temp Page Table vaddr 0~4MB
     cprintf("setup Page Table for vaddr 0X1000, so alloc a page\n");
c0104a13:	83 ec 0c             	sub    $0xc,%esp
c0104a16:	68 68 96 10 c0       	push   $0xc0109668
c0104a1b:	e8 8a b8 ff ff       	call   c01002aa <cprintf>
c0104a20:	83 c4 10             	add    $0x10,%esp
     pte_t *temp_ptep=NULL;
c0104a23:	c7 45 d8 00 00 00 00 	movl   $0x0,-0x28(%ebp)
     temp_ptep = get_pte(mm->pgdir, BEING_CHECK_VALID_VADDR, 1);
c0104a2a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104a2d:	8b 40 0c             	mov    0xc(%eax),%eax
c0104a30:	83 ec 04             	sub    $0x4,%esp
c0104a33:	6a 01                	push   $0x1
c0104a35:	68 00 10 00 00       	push   $0x1000
c0104a3a:	50                   	push   %eax
c0104a3b:	e8 70 1e 00 00       	call   c01068b0 <get_pte>
c0104a40:	83 c4 10             	add    $0x10,%esp
c0104a43:	89 45 d8             	mov    %eax,-0x28(%ebp)
     assert(temp_ptep!= NULL);
c0104a46:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
c0104a4a:	75 19                	jne    c0104a65 <check_swap+0x1f8>
c0104a4c:	68 9c 96 10 c0       	push   $0xc010969c
c0104a51:	68 de 94 10 c0       	push   $0xc01094de
c0104a56:	68 d4 00 00 00       	push   $0xd4
c0104a5b:	68 78 94 10 c0       	push   $0xc0109478
c0104a60:	e8 c0 b9 ff ff       	call   c0100425 <__panic>
     cprintf("setup Page Table vaddr 0~4MB OVER!\n");
c0104a65:	83 ec 0c             	sub    $0xc,%esp
c0104a68:	68 b0 96 10 c0       	push   $0xc01096b0
c0104a6d:	e8 38 b8 ff ff       	call   c01002aa <cprintf>
c0104a72:	83 c4 10             	add    $0x10,%esp
     
     for (i=0;i<CHECK_VALID_PHY_PAGE_NUM;i++) {
c0104a75:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
c0104a7c:	e9 8e 00 00 00       	jmp    c0104b0f <check_swap+0x2a2>
          check_rp[i] = alloc_page();
c0104a81:	83 ec 0c             	sub    $0xc,%esp
c0104a84:	6a 01                	push   $0x1
c0104a86:	e8 c0 17 00 00       	call   c010624b <alloc_pages>
c0104a8b:	83 c4 10             	add    $0x10,%esp
c0104a8e:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0104a91:	89 04 95 20 60 12 c0 	mov    %eax,-0x3fed9fe0(,%edx,4)
          assert(check_rp[i] != NULL );
c0104a98:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104a9b:	8b 04 85 20 60 12 c0 	mov    -0x3fed9fe0(,%eax,4),%eax
c0104aa2:	85 c0                	test   %eax,%eax
c0104aa4:	75 19                	jne    c0104abf <check_swap+0x252>
c0104aa6:	68 d4 96 10 c0       	push   $0xc01096d4
c0104aab:	68 de 94 10 c0       	push   $0xc01094de
c0104ab0:	68 d9 00 00 00       	push   $0xd9
c0104ab5:	68 78 94 10 c0       	push   $0xc0109478
c0104aba:	e8 66 b9 ff ff       	call   c0100425 <__panic>
          assert(!PageProperty(check_rp[i]));
c0104abf:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104ac2:	8b 04 85 20 60 12 c0 	mov    -0x3fed9fe0(,%eax,4),%eax
c0104ac9:	83 c0 04             	add    $0x4,%eax
c0104acc:	c7 45 b4 01 00 00 00 	movl   $0x1,-0x4c(%ebp)
c0104ad3:	89 45 b0             	mov    %eax,-0x50(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0104ad6:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0104ad9:	8b 55 b4             	mov    -0x4c(%ebp),%edx
c0104adc:	0f a3 10             	bt     %edx,(%eax)
c0104adf:	19 c0                	sbb    %eax,%eax
c0104ae1:	89 45 ac             	mov    %eax,-0x54(%ebp)
    return oldbit != 0;
c0104ae4:	83 7d ac 00          	cmpl   $0x0,-0x54(%ebp)
c0104ae8:	0f 95 c0             	setne  %al
c0104aeb:	0f b6 c0             	movzbl %al,%eax
c0104aee:	85 c0                	test   %eax,%eax
c0104af0:	74 19                	je     c0104b0b <check_swap+0x29e>
c0104af2:	68 e8 96 10 c0       	push   $0xc01096e8
c0104af7:	68 de 94 10 c0       	push   $0xc01094de
c0104afc:	68 da 00 00 00       	push   $0xda
c0104b01:	68 78 94 10 c0       	push   $0xc0109478
c0104b06:	e8 1a b9 ff ff       	call   c0100425 <__panic>
     for (i=0;i<CHECK_VALID_PHY_PAGE_NUM;i++) {
c0104b0b:	83 45 ec 01          	addl   $0x1,-0x14(%ebp)
c0104b0f:	83 7d ec 03          	cmpl   $0x3,-0x14(%ebp)
c0104b13:	0f 8e 68 ff ff ff    	jle    c0104a81 <check_swap+0x214>
     }
     list_entry_t free_list_store = free_list;
c0104b19:	a1 e4 60 12 c0       	mov    0xc01260e4,%eax
c0104b1e:	8b 15 e8 60 12 c0    	mov    0xc01260e8,%edx
c0104b24:	89 45 98             	mov    %eax,-0x68(%ebp)
c0104b27:	89 55 9c             	mov    %edx,-0x64(%ebp)
c0104b2a:	c7 45 a4 e4 60 12 c0 	movl   $0xc01260e4,-0x5c(%ebp)
    elm->prev = elm->next = elm;
c0104b31:	8b 45 a4             	mov    -0x5c(%ebp),%eax
c0104b34:	8b 55 a4             	mov    -0x5c(%ebp),%edx
c0104b37:	89 50 04             	mov    %edx,0x4(%eax)
c0104b3a:	8b 45 a4             	mov    -0x5c(%ebp),%eax
c0104b3d:	8b 50 04             	mov    0x4(%eax),%edx
c0104b40:	8b 45 a4             	mov    -0x5c(%ebp),%eax
c0104b43:	89 10                	mov    %edx,(%eax)
}
c0104b45:	90                   	nop
c0104b46:	c7 45 a8 e4 60 12 c0 	movl   $0xc01260e4,-0x58(%ebp)
    return list->next == list;
c0104b4d:	8b 45 a8             	mov    -0x58(%ebp),%eax
c0104b50:	8b 40 04             	mov    0x4(%eax),%eax
c0104b53:	39 45 a8             	cmp    %eax,-0x58(%ebp)
c0104b56:	0f 94 c0             	sete   %al
c0104b59:	0f b6 c0             	movzbl %al,%eax
     list_init(&free_list);
     assert(list_empty(&free_list));
c0104b5c:	85 c0                	test   %eax,%eax
c0104b5e:	75 19                	jne    c0104b79 <check_swap+0x30c>
c0104b60:	68 03 97 10 c0       	push   $0xc0109703
c0104b65:	68 de 94 10 c0       	push   $0xc01094de
c0104b6a:	68 de 00 00 00       	push   $0xde
c0104b6f:	68 78 94 10 c0       	push   $0xc0109478
c0104b74:	e8 ac b8 ff ff       	call   c0100425 <__panic>
     
     //assert(alloc_page() == NULL);
     
     unsigned int nr_free_store = nr_free;
c0104b79:	a1 ec 60 12 c0       	mov    0xc01260ec,%eax
c0104b7e:	89 45 d4             	mov    %eax,-0x2c(%ebp)
     nr_free = 0;
c0104b81:	c7 05 ec 60 12 c0 00 	movl   $0x0,0xc01260ec
c0104b88:	00 00 00 
     for (i=0;i<CHECK_VALID_PHY_PAGE_NUM;i++) {
c0104b8b:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
c0104b92:	eb 1c                	jmp    c0104bb0 <check_swap+0x343>
        free_pages(check_rp[i],1);
c0104b94:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104b97:	8b 04 85 20 60 12 c0 	mov    -0x3fed9fe0(,%eax,4),%eax
c0104b9e:	83 ec 08             	sub    $0x8,%esp
c0104ba1:	6a 01                	push   $0x1
c0104ba3:	50                   	push   %eax
c0104ba4:	e8 12 17 00 00       	call   c01062bb <free_pages>
c0104ba9:	83 c4 10             	add    $0x10,%esp
     for (i=0;i<CHECK_VALID_PHY_PAGE_NUM;i++) {
c0104bac:	83 45 ec 01          	addl   $0x1,-0x14(%ebp)
c0104bb0:	83 7d ec 03          	cmpl   $0x3,-0x14(%ebp)
c0104bb4:	7e de                	jle    c0104b94 <check_swap+0x327>
     }
     assert(nr_free==CHECK_VALID_PHY_PAGE_NUM);
c0104bb6:	a1 ec 60 12 c0       	mov    0xc01260ec,%eax
c0104bbb:	83 f8 04             	cmp    $0x4,%eax
c0104bbe:	74 19                	je     c0104bd9 <check_swap+0x36c>
c0104bc0:	68 1c 97 10 c0       	push   $0xc010971c
c0104bc5:	68 de 94 10 c0       	push   $0xc01094de
c0104bca:	68 e7 00 00 00       	push   $0xe7
c0104bcf:	68 78 94 10 c0       	push   $0xc0109478
c0104bd4:	e8 4c b8 ff ff       	call   c0100425 <__panic>
     
     cprintf("set up init env for check_swap begin!\n");
c0104bd9:	83 ec 0c             	sub    $0xc,%esp
c0104bdc:	68 40 97 10 c0       	push   $0xc0109740
c0104be1:	e8 c4 b6 ff ff       	call   c01002aa <cprintf>
c0104be6:	83 c4 10             	add    $0x10,%esp
     //setup initial vir_page<->phy_page environment for page relpacement algorithm 

     
     pgfault_num=0;
c0104be9:	c7 05 64 5f 12 c0 00 	movl   $0x0,0xc0125f64
c0104bf0:	00 00 00 
     
     check_content_set();
c0104bf3:	e8 fc fa ff ff       	call   c01046f4 <check_content_set>
     assert( nr_free == 0);         
c0104bf8:	a1 ec 60 12 c0       	mov    0xc01260ec,%eax
c0104bfd:	85 c0                	test   %eax,%eax
c0104bff:	74 19                	je     c0104c1a <check_swap+0x3ad>
c0104c01:	68 67 97 10 c0       	push   $0xc0109767
c0104c06:	68 de 94 10 c0       	push   $0xc01094de
c0104c0b:	68 f0 00 00 00       	push   $0xf0
c0104c10:	68 78 94 10 c0       	push   $0xc0109478
c0104c15:	e8 0b b8 ff ff       	call   c0100425 <__panic>
     for(i = 0; i<MAX_SEQ_NO ; i++) 
c0104c1a:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
c0104c21:	eb 26                	jmp    c0104c49 <check_swap+0x3dc>
         swap_out_seq_no[i]=swap_in_seq_no[i]=-1;
c0104c23:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104c26:	c7 04 85 40 60 12 c0 	movl   $0xffffffff,-0x3fed9fc0(,%eax,4)
c0104c2d:	ff ff ff ff 
c0104c31:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104c34:	8b 14 85 40 60 12 c0 	mov    -0x3fed9fc0(,%eax,4),%edx
c0104c3b:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104c3e:	89 14 85 80 60 12 c0 	mov    %edx,-0x3fed9f80(,%eax,4)
     for(i = 0; i<MAX_SEQ_NO ; i++) 
c0104c45:	83 45 ec 01          	addl   $0x1,-0x14(%ebp)
c0104c49:	83 7d ec 09          	cmpl   $0x9,-0x14(%ebp)
c0104c4d:	7e d4                	jle    c0104c23 <check_swap+0x3b6>
     
     for (i= 0;i<CHECK_VALID_PHY_PAGE_NUM;i++) {
c0104c4f:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
c0104c56:	e9 c8 00 00 00       	jmp    c0104d23 <check_swap+0x4b6>
         check_ptep[i]=0;
c0104c5b:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104c5e:	c7 04 85 d4 60 12 c0 	movl   $0x0,-0x3fed9f2c(,%eax,4)
c0104c65:	00 00 00 00 
         check_ptep[i] = get_pte(pgdir, (i+1)*0x1000, 0);
c0104c69:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104c6c:	83 c0 01             	add    $0x1,%eax
c0104c6f:	c1 e0 0c             	shl    $0xc,%eax
c0104c72:	83 ec 04             	sub    $0x4,%esp
c0104c75:	6a 00                	push   $0x0
c0104c77:	50                   	push   %eax
c0104c78:	ff 75 e0             	pushl  -0x20(%ebp)
c0104c7b:	e8 30 1c 00 00       	call   c01068b0 <get_pte>
c0104c80:	83 c4 10             	add    $0x10,%esp
c0104c83:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0104c86:	89 04 95 d4 60 12 c0 	mov    %eax,-0x3fed9f2c(,%edx,4)
         //cprintf("i %d, check_ptep addr %x, value %x\n", i, check_ptep[i], *check_ptep[i]);
         assert(check_ptep[i] != NULL);
c0104c8d:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104c90:	8b 04 85 d4 60 12 c0 	mov    -0x3fed9f2c(,%eax,4),%eax
c0104c97:	85 c0                	test   %eax,%eax
c0104c99:	75 19                	jne    c0104cb4 <check_swap+0x447>
c0104c9b:	68 74 97 10 c0       	push   $0xc0109774
c0104ca0:	68 de 94 10 c0       	push   $0xc01094de
c0104ca5:	68 f8 00 00 00       	push   $0xf8
c0104caa:	68 78 94 10 c0       	push   $0xc0109478
c0104caf:	e8 71 b7 ff ff       	call   c0100425 <__panic>
         assert(pte2page(*check_ptep[i]) == check_rp[i]);
c0104cb4:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104cb7:	8b 04 85 d4 60 12 c0 	mov    -0x3fed9f2c(,%eax,4),%eax
c0104cbe:	8b 00                	mov    (%eax),%eax
c0104cc0:	83 ec 0c             	sub    $0xc,%esp
c0104cc3:	50                   	push   %eax
c0104cc4:	e8 d9 f6 ff ff       	call   c01043a2 <pte2page>
c0104cc9:	83 c4 10             	add    $0x10,%esp
c0104ccc:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0104ccf:	8b 14 95 20 60 12 c0 	mov    -0x3fed9fe0(,%edx,4),%edx
c0104cd6:	39 d0                	cmp    %edx,%eax
c0104cd8:	74 19                	je     c0104cf3 <check_swap+0x486>
c0104cda:	68 8c 97 10 c0       	push   $0xc010978c
c0104cdf:	68 de 94 10 c0       	push   $0xc01094de
c0104ce4:	68 f9 00 00 00       	push   $0xf9
c0104ce9:	68 78 94 10 c0       	push   $0xc0109478
c0104cee:	e8 32 b7 ff ff       	call   c0100425 <__panic>
         assert((*check_ptep[i] & PTE_P));          
c0104cf3:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104cf6:	8b 04 85 d4 60 12 c0 	mov    -0x3fed9f2c(,%eax,4),%eax
c0104cfd:	8b 00                	mov    (%eax),%eax
c0104cff:	83 e0 01             	and    $0x1,%eax
c0104d02:	85 c0                	test   %eax,%eax
c0104d04:	75 19                	jne    c0104d1f <check_swap+0x4b2>
c0104d06:	68 b4 97 10 c0       	push   $0xc01097b4
c0104d0b:	68 de 94 10 c0       	push   $0xc01094de
c0104d10:	68 fa 00 00 00       	push   $0xfa
c0104d15:	68 78 94 10 c0       	push   $0xc0109478
c0104d1a:	e8 06 b7 ff ff       	call   c0100425 <__panic>
     for (i= 0;i<CHECK_VALID_PHY_PAGE_NUM;i++) {
c0104d1f:	83 45 ec 01          	addl   $0x1,-0x14(%ebp)
c0104d23:	83 7d ec 03          	cmpl   $0x3,-0x14(%ebp)
c0104d27:	0f 8e 2e ff ff ff    	jle    c0104c5b <check_swap+0x3ee>
     }
     cprintf("set up init env for check_swap over!\n");
c0104d2d:	83 ec 0c             	sub    $0xc,%esp
c0104d30:	68 d0 97 10 c0       	push   $0xc01097d0
c0104d35:	e8 70 b5 ff ff       	call   c01002aa <cprintf>
c0104d3a:	83 c4 10             	add    $0x10,%esp
     // now access the virt pages to test  page relpacement algorithm 
     ret=check_content_access();
c0104d3d:	e8 13 fb ff ff       	call   c0104855 <check_content_access>
c0104d42:	89 45 d0             	mov    %eax,-0x30(%ebp)
     assert(ret==0);
c0104d45:	83 7d d0 00          	cmpl   $0x0,-0x30(%ebp)
c0104d49:	74 19                	je     c0104d64 <check_swap+0x4f7>
c0104d4b:	68 f6 97 10 c0       	push   $0xc01097f6
c0104d50:	68 de 94 10 c0       	push   $0xc01094de
c0104d55:	68 ff 00 00 00       	push   $0xff
c0104d5a:	68 78 94 10 c0       	push   $0xc0109478
c0104d5f:	e8 c1 b6 ff ff       	call   c0100425 <__panic>
     
     //restore kernel mem env
     for (i=0;i<CHECK_VALID_PHY_PAGE_NUM;i++) {
c0104d64:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
c0104d6b:	eb 1c                	jmp    c0104d89 <check_swap+0x51c>
         free_pages(check_rp[i],1);
c0104d6d:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104d70:	8b 04 85 20 60 12 c0 	mov    -0x3fed9fe0(,%eax,4),%eax
c0104d77:	83 ec 08             	sub    $0x8,%esp
c0104d7a:	6a 01                	push   $0x1
c0104d7c:	50                   	push   %eax
c0104d7d:	e8 39 15 00 00       	call   c01062bb <free_pages>
c0104d82:	83 c4 10             	add    $0x10,%esp
     for (i=0;i<CHECK_VALID_PHY_PAGE_NUM;i++) {
c0104d85:	83 45 ec 01          	addl   $0x1,-0x14(%ebp)
c0104d89:	83 7d ec 03          	cmpl   $0x3,-0x14(%ebp)
c0104d8d:	7e de                	jle    c0104d6d <check_swap+0x500>
     } 

     //free_page(pte2page(*temp_ptep));
     
     mm_destroy(mm);
c0104d8f:	83 ec 0c             	sub    $0xc,%esp
c0104d92:	ff 75 e4             	pushl  -0x1c(%ebp)
c0104d95:	e8 18 e8 ff ff       	call   c01035b2 <mm_destroy>
c0104d9a:	83 c4 10             	add    $0x10,%esp
         
     nr_free = nr_free_store;
c0104d9d:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0104da0:	a3 ec 60 12 c0       	mov    %eax,0xc01260ec
     free_list = free_list_store;
c0104da5:	8b 45 98             	mov    -0x68(%ebp),%eax
c0104da8:	8b 55 9c             	mov    -0x64(%ebp),%edx
c0104dab:	a3 e4 60 12 c0       	mov    %eax,0xc01260e4
c0104db0:	89 15 e8 60 12 c0    	mov    %edx,0xc01260e8

     
     le = &free_list;
c0104db6:	c7 45 e8 e4 60 12 c0 	movl   $0xc01260e4,-0x18(%ebp)
     while ((le = list_next(le)) != &free_list) {
c0104dbd:	eb 1d                	jmp    c0104ddc <check_swap+0x56f>
         struct Page *p = le2page(le, page_link);
c0104dbf:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0104dc2:	83 e8 0c             	sub    $0xc,%eax
c0104dc5:	89 45 cc             	mov    %eax,-0x34(%ebp)
         count --, total -= p->property;
c0104dc8:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
c0104dcc:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0104dcf:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0104dd2:	8b 40 08             	mov    0x8(%eax),%eax
c0104dd5:	29 c2                	sub    %eax,%edx
c0104dd7:	89 d0                	mov    %edx,%eax
c0104dd9:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0104ddc:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0104ddf:	89 45 a0             	mov    %eax,-0x60(%ebp)
    return listelm->next;
c0104de2:	8b 45 a0             	mov    -0x60(%ebp),%eax
c0104de5:	8b 40 04             	mov    0x4(%eax),%eax
     while ((le = list_next(le)) != &free_list) {
c0104de8:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0104deb:	81 7d e8 e4 60 12 c0 	cmpl   $0xc01260e4,-0x18(%ebp)
c0104df2:	75 cb                	jne    c0104dbf <check_swap+0x552>
     }
     cprintf("count is %d, total is %d\n",count,total);
c0104df4:	83 ec 04             	sub    $0x4,%esp
c0104df7:	ff 75 f0             	pushl  -0x10(%ebp)
c0104dfa:	ff 75 f4             	pushl  -0xc(%ebp)
c0104dfd:	68 fd 97 10 c0       	push   $0xc01097fd
c0104e02:	e8 a3 b4 ff ff       	call   c01002aa <cprintf>
c0104e07:	83 c4 10             	add    $0x10,%esp
     //assert(count == 0);
     
     cprintf("check_swap() succeeded!\n");
c0104e0a:	83 ec 0c             	sub    $0xc,%esp
c0104e0d:	68 17 98 10 c0       	push   $0xc0109817
c0104e12:	e8 93 b4 ff ff       	call   c01002aa <cprintf>
c0104e17:	83 c4 10             	add    $0x10,%esp
}
c0104e1a:	90                   	nop
c0104e1b:	c9                   	leave  
c0104e1c:	c3                   	ret    

c0104e1d <page2ppn>:
page2ppn(struct Page *page) {
c0104e1d:	55                   	push   %ebp
c0104e1e:	89 e5                	mov    %esp,%ebp
    return page - pages;
c0104e20:	a1 f8 60 12 c0       	mov    0xc01260f8,%eax
c0104e25:	8b 55 08             	mov    0x8(%ebp),%edx
c0104e28:	29 c2                	sub    %eax,%edx
c0104e2a:	89 d0                	mov    %edx,%eax
c0104e2c:	c1 f8 05             	sar    $0x5,%eax
}
c0104e2f:	5d                   	pop    %ebp
c0104e30:	c3                   	ret    

c0104e31 <page2pa>:
page2pa(struct Page *page) {
c0104e31:	55                   	push   %ebp
c0104e32:	89 e5                	mov    %esp,%ebp
    return page2ppn(page) << PGSHIFT;
c0104e34:	ff 75 08             	pushl  0x8(%ebp)
c0104e37:	e8 e1 ff ff ff       	call   c0104e1d <page2ppn>
c0104e3c:	83 c4 04             	add    $0x4,%esp
c0104e3f:	c1 e0 0c             	shl    $0xc,%eax
}
c0104e42:	c9                   	leave  
c0104e43:	c3                   	ret    

c0104e44 <page_ref>:

static inline int
page_ref(struct Page *page) {
c0104e44:	55                   	push   %ebp
c0104e45:	89 e5                	mov    %esp,%ebp
    return page->ref;
c0104e47:	8b 45 08             	mov    0x8(%ebp),%eax
c0104e4a:	8b 00                	mov    (%eax),%eax
}
c0104e4c:	5d                   	pop    %ebp
c0104e4d:	c3                   	ret    

c0104e4e <set_page_ref>:

static inline void
set_page_ref(struct Page *page, int val) {
c0104e4e:	55                   	push   %ebp
c0104e4f:	89 e5                	mov    %esp,%ebp
    page->ref = val;
c0104e51:	8b 45 08             	mov    0x8(%ebp),%eax
c0104e54:	8b 55 0c             	mov    0xc(%ebp),%edx
c0104e57:	89 10                	mov    %edx,(%eax)
}
c0104e59:	90                   	nop
c0104e5a:	5d                   	pop    %ebp
c0104e5b:	c3                   	ret    

c0104e5c <default_init>:

#define free_list (free_area.free_list)
#define nr_free (free_area.nr_free)

static void
default_init(void) {
c0104e5c:	f3 0f 1e fb          	endbr32 
c0104e60:	55                   	push   %ebp
c0104e61:	89 e5                	mov    %esp,%ebp
c0104e63:	83 ec 10             	sub    $0x10,%esp
c0104e66:	c7 45 fc e4 60 12 c0 	movl   $0xc01260e4,-0x4(%ebp)
    elm->prev = elm->next = elm;
c0104e6d:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0104e70:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0104e73:	89 50 04             	mov    %edx,0x4(%eax)
c0104e76:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0104e79:	8b 50 04             	mov    0x4(%eax),%edx
c0104e7c:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0104e7f:	89 10                	mov    %edx,(%eax)
}
c0104e81:	90                   	nop
    list_init(&free_list);
    nr_free = 0;
c0104e82:	c7 05 ec 60 12 c0 00 	movl   $0x0,0xc01260ec
c0104e89:	00 00 00 
}
c0104e8c:	90                   	nop
c0104e8d:	c9                   	leave  
c0104e8e:	c3                   	ret    

c0104e8f <default_init_memmap>:
// 需要注意，default_init_memmap default_alloc_pages default_free_pages 三个函数只是给大家提供一点思路
// 需要大家去重写函数
// 这里需要大家去理解通用链表结构 即list_entry_t与Page结构的关系
// 注意在分配和回收Page时候，注意设置FLAGS property等数据结构
static void
default_init_memmap(struct Page *base, size_t n) { // 这里是在对一个基础块进行初始化
c0104e8f:	f3 0f 1e fb          	endbr32 
c0104e93:	55                   	push   %ebp
c0104e94:	89 e5                	mov    %esp,%ebp
c0104e96:	83 ec 38             	sub    $0x38,%esp
    assert(n > 0);
c0104e99:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0104e9d:	75 16                	jne    c0104eb5 <default_init_memmap+0x26>
c0104e9f:	68 30 98 10 c0       	push   $0xc0109830
c0104ea4:	68 36 98 10 c0       	push   $0xc0109836
c0104ea9:	6a 74                	push   $0x74
c0104eab:	68 4b 98 10 c0       	push   $0xc010984b
c0104eb0:	e8 70 b5 ff ff       	call   c0100425 <__panic>
    struct Page *p = base;
c0104eb5:	8b 45 08             	mov    0x8(%ebp),%eax
c0104eb8:	89 45 f4             	mov    %eax,-0xc(%ebp)
    for (; p != base + n; p ++) {
c0104ebb:	eb 6c                	jmp    c0104f29 <default_init_memmap+0x9a>
        assert(PageReserved(p));
c0104ebd:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104ec0:	83 c0 04             	add    $0x4,%eax
c0104ec3:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
c0104eca:	89 45 ec             	mov    %eax,-0x14(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0104ecd:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104ed0:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0104ed3:	0f a3 10             	bt     %edx,(%eax)
c0104ed6:	19 c0                	sbb    %eax,%eax
c0104ed8:	89 45 e8             	mov    %eax,-0x18(%ebp)
    return oldbit != 0;
c0104edb:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0104edf:	0f 95 c0             	setne  %al
c0104ee2:	0f b6 c0             	movzbl %al,%eax
c0104ee5:	85 c0                	test   %eax,%eax
c0104ee7:	75 16                	jne    c0104eff <default_init_memmap+0x70>
c0104ee9:	68 61 98 10 c0       	push   $0xc0109861
c0104eee:	68 36 98 10 c0       	push   $0xc0109836
c0104ef3:	6a 77                	push   $0x77
c0104ef5:	68 4b 98 10 c0       	push   $0xc010984b
c0104efa:	e8 26 b5 ff ff       	call   c0100425 <__panic>
        p->flags = p->property = 0;
c0104eff:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104f02:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
c0104f09:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104f0c:	8b 50 08             	mov    0x8(%eax),%edx
c0104f0f:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104f12:	89 50 04             	mov    %edx,0x4(%eax)
        set_page_ref(p, 0);
c0104f15:	83 ec 08             	sub    $0x8,%esp
c0104f18:	6a 00                	push   $0x0
c0104f1a:	ff 75 f4             	pushl  -0xc(%ebp)
c0104f1d:	e8 2c ff ff ff       	call   c0104e4e <set_page_ref>
c0104f22:	83 c4 10             	add    $0x10,%esp
    for (; p != base + n; p ++) {
c0104f25:	83 45 f4 20          	addl   $0x20,-0xc(%ebp)
c0104f29:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104f2c:	c1 e0 05             	shl    $0x5,%eax
c0104f2f:	89 c2                	mov    %eax,%edx
c0104f31:	8b 45 08             	mov    0x8(%ebp),%eax
c0104f34:	01 d0                	add    %edx,%eax
c0104f36:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0104f39:	75 82                	jne    c0104ebd <default_init_memmap+0x2e>
    }
    base->property = n;
c0104f3b:	8b 45 08             	mov    0x8(%ebp),%eax
c0104f3e:	8b 55 0c             	mov    0xc(%ebp),%edx
c0104f41:	89 50 08             	mov    %edx,0x8(%eax)
    SetPageProperty(base);
c0104f44:	8b 45 08             	mov    0x8(%ebp),%eax
c0104f47:	83 c0 04             	add    $0x4,%eax
c0104f4a:	c7 45 d0 01 00 00 00 	movl   $0x1,-0x30(%ebp)
c0104f51:	89 45 cc             	mov    %eax,-0x34(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0104f54:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0104f57:	8b 55 d0             	mov    -0x30(%ebp),%edx
c0104f5a:	0f ab 10             	bts    %edx,(%eax)
}
c0104f5d:	90                   	nop
    nr_free += n;
c0104f5e:	8b 15 ec 60 12 c0    	mov    0xc01260ec,%edx
c0104f64:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104f67:	01 d0                	add    %edx,%eax
c0104f69:	a3 ec 60 12 c0       	mov    %eax,0xc01260ec
    list_add_before(&free_list, &(base->page_link));
c0104f6e:	8b 45 08             	mov    0x8(%ebp),%eax
c0104f71:	83 c0 0c             	add    $0xc,%eax
c0104f74:	c7 45 e4 e4 60 12 c0 	movl   $0xc01260e4,-0x1c(%ebp)
c0104f7b:	89 45 e0             	mov    %eax,-0x20(%ebp)
    __list_add(elm, listelm->prev, listelm);
c0104f7e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104f81:	8b 00                	mov    (%eax),%eax
c0104f83:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0104f86:	89 55 dc             	mov    %edx,-0x24(%ebp)
c0104f89:	89 45 d8             	mov    %eax,-0x28(%ebp)
c0104f8c:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104f8f:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    prev->next = next->prev = elm;
c0104f92:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0104f95:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104f98:	89 10                	mov    %edx,(%eax)
c0104f9a:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0104f9d:	8b 10                	mov    (%eax),%edx
c0104f9f:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0104fa2:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0104fa5:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0104fa8:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0104fab:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0104fae:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0104fb1:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0104fb4:	89 10                	mov    %edx,(%eax)
}
c0104fb6:	90                   	nop
}
c0104fb7:	90                   	nop
}
c0104fb8:	90                   	nop
c0104fb9:	c9                   	leave  
c0104fba:	c3                   	ret    

c0104fbb <default_alloc_pages>:

static struct Page *
default_alloc_pages(size_t n) {
c0104fbb:	f3 0f 1e fb          	endbr32 
c0104fbf:	55                   	push   %ebp
c0104fc0:	89 e5                	mov    %esp,%ebp
c0104fc2:	83 ec 58             	sub    $0x58,%esp
    cprintf("=============================== ALLOC PAGES ===============================");
c0104fc5:	83 ec 0c             	sub    $0xc,%esp
c0104fc8:	68 74 98 10 c0       	push   $0xc0109874
c0104fcd:	e8 d8 b2 ff ff       	call   c01002aa <cprintf>
c0104fd2:	83 c4 10             	add    $0x10,%esp
    cprintf("page_size :: %d\n",(long long) n);
c0104fd5:	8b 45 08             	mov    0x8(%ebp),%eax
c0104fd8:	ba 00 00 00 00       	mov    $0x0,%edx
c0104fdd:	83 ec 04             	sub    $0x4,%esp
c0104fe0:	52                   	push   %edx
c0104fe1:	50                   	push   %eax
c0104fe2:	68 c0 98 10 c0       	push   $0xc01098c0
c0104fe7:	e8 be b2 ff ff       	call   c01002aa <cprintf>
c0104fec:	83 c4 10             	add    $0x10,%esp
    assert(n > 0);
c0104fef:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0104ff3:	75 19                	jne    c010500e <default_alloc_pages+0x53>
c0104ff5:	68 30 98 10 c0       	push   $0xc0109830
c0104ffa:	68 36 98 10 c0       	push   $0xc0109836
c0104fff:	68 85 00 00 00       	push   $0x85
c0105004:	68 4b 98 10 c0       	push   $0xc010984b
c0105009:	e8 17 b4 ff ff       	call   c0100425 <__panic>
    if (n > nr_free) {
c010500e:	a1 ec 60 12 c0       	mov    0xc01260ec,%eax
c0105013:	39 45 08             	cmp    %eax,0x8(%ebp)
c0105016:	76 0a                	jbe    c0105022 <default_alloc_pages+0x67>
        return NULL;
c0105018:	b8 00 00 00 00       	mov    $0x0,%eax
c010501d:	e9 52 01 00 00       	jmp    c0105174 <default_alloc_pages+0x1b9>
    }
    struct Page *page = NULL;
c0105022:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    list_entry_t *le = &free_list;
c0105029:	c7 45 f0 e4 60 12 c0 	movl   $0xc01260e4,-0x10(%ebp)
    while ((le = list_next(le)) != &free_list) {
c0105030:	eb 2f                	jmp    c0105061 <default_alloc_pages+0xa6>
        struct Page *p = le2page(le, page_link);
c0105032:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105035:	83 e8 0c             	sub    $0xc,%eax
c0105038:	89 45 ec             	mov    %eax,-0x14(%ebp)
        cprintf("try to use block: %lx \n", p);
c010503b:	83 ec 08             	sub    $0x8,%esp
c010503e:	ff 75 ec             	pushl  -0x14(%ebp)
c0105041:	68 d1 98 10 c0       	push   $0xc01098d1
c0105046:	e8 5f b2 ff ff       	call   c01002aa <cprintf>
c010504b:	83 c4 10             	add    $0x10,%esp
        if (p->property >= n) {
c010504e:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105051:	8b 40 08             	mov    0x8(%eax),%eax
c0105054:	39 45 08             	cmp    %eax,0x8(%ebp)
c0105057:	77 08                	ja     c0105061 <default_alloc_pages+0xa6>
            page = p;
c0105059:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010505c:	89 45 f4             	mov    %eax,-0xc(%ebp)
            break;
c010505f:	eb 18                	jmp    c0105079 <default_alloc_pages+0xbe>
c0105061:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105064:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    return listelm->next;
c0105067:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010506a:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &free_list) {
c010506d:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105070:	81 7d f0 e4 60 12 c0 	cmpl   $0xc01260e4,-0x10(%ebp)
c0105077:	75 b9                	jne    c0105032 <default_alloc_pages+0x77>
        }
    }
    if (page != NULL) {
c0105079:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c010507d:	0f 84 d8 00 00 00    	je     c010515b <default_alloc_pages+0x1a0>
        list_del(&(page->page_link));
c0105083:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105086:	83 c0 0c             	add    $0xc,%eax
c0105089:	89 45 e0             	mov    %eax,-0x20(%ebp)
    __list_del(listelm->prev, listelm->next);
c010508c:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010508f:	8b 40 04             	mov    0x4(%eax),%eax
c0105092:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0105095:	8b 12                	mov    (%edx),%edx
c0105097:	89 55 dc             	mov    %edx,-0x24(%ebp)
c010509a:	89 45 d8             	mov    %eax,-0x28(%ebp)
    prev->next = next;
c010509d:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01050a0:	8b 55 d8             	mov    -0x28(%ebp),%edx
c01050a3:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c01050a6:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01050a9:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01050ac:	89 10                	mov    %edx,(%eax)
}
c01050ae:	90                   	nop
}
c01050af:	90                   	nop
        if (page->property > n) {
c01050b0:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01050b3:	8b 40 08             	mov    0x8(%eax),%eax
c01050b6:	39 45 08             	cmp    %eax,0x8(%ebp)
c01050b9:	73 79                	jae    c0105134 <default_alloc_pages+0x179>
            struct Page *p = page + n;
c01050bb:	8b 45 08             	mov    0x8(%ebp),%eax
c01050be:	c1 e0 05             	shl    $0x5,%eax
c01050c1:	89 c2                	mov    %eax,%edx
c01050c3:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01050c6:	01 d0                	add    %edx,%eax
c01050c8:	89 45 e8             	mov    %eax,-0x18(%ebp)
            p->property = page->property - n;
c01050cb:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01050ce:	8b 40 08             	mov    0x8(%eax),%eax
c01050d1:	2b 45 08             	sub    0x8(%ebp),%eax
c01050d4:	89 c2                	mov    %eax,%edx
c01050d6:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01050d9:	89 50 08             	mov    %edx,0x8(%eax)
            list_add(&free_list, &(p->page_link));
c01050dc:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01050df:	83 c0 0c             	add    $0xc,%eax
c01050e2:	c7 45 d4 e4 60 12 c0 	movl   $0xc01260e4,-0x2c(%ebp)
c01050e9:	89 45 d0             	mov    %eax,-0x30(%ebp)
c01050ec:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01050ef:	89 45 cc             	mov    %eax,-0x34(%ebp)
c01050f2:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01050f5:	89 45 c8             	mov    %eax,-0x38(%ebp)
    __list_add(elm, listelm, listelm->next);
c01050f8:	8b 45 cc             	mov    -0x34(%ebp),%eax
c01050fb:	8b 40 04             	mov    0x4(%eax),%eax
c01050fe:	8b 55 c8             	mov    -0x38(%ebp),%edx
c0105101:	89 55 c4             	mov    %edx,-0x3c(%ebp)
c0105104:	8b 55 cc             	mov    -0x34(%ebp),%edx
c0105107:	89 55 c0             	mov    %edx,-0x40(%ebp)
c010510a:	89 45 bc             	mov    %eax,-0x44(%ebp)
    prev->next = next->prev = elm;
c010510d:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0105110:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c0105113:	89 10                	mov    %edx,(%eax)
c0105115:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0105118:	8b 10                	mov    (%eax),%edx
c010511a:	8b 45 c0             	mov    -0x40(%ebp),%eax
c010511d:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0105120:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0105123:	8b 55 bc             	mov    -0x44(%ebp),%edx
c0105126:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0105129:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c010512c:	8b 55 c0             	mov    -0x40(%ebp),%edx
c010512f:	89 10                	mov    %edx,(%eax)
}
c0105131:	90                   	nop
}
c0105132:	90                   	nop
}
c0105133:	90                   	nop
        }
        nr_free -= n;
c0105134:	a1 ec 60 12 c0       	mov    0xc01260ec,%eax
c0105139:	2b 45 08             	sub    0x8(%ebp),%eax
c010513c:	a3 ec 60 12 c0       	mov    %eax,0xc01260ec
        ClearPageProperty(page);
c0105141:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105144:	83 c0 04             	add    $0x4,%eax
c0105147:	c7 45 b8 01 00 00 00 	movl   $0x1,-0x48(%ebp)
c010514e:	89 45 b4             	mov    %eax,-0x4c(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0105151:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c0105154:	8b 55 b8             	mov    -0x48(%ebp),%edx
c0105157:	0f b3 10             	btr    %edx,(%eax)
}
c010515a:	90                   	nop
    }
    cprintf("page addr :: %lx\n", (int64_t)page);
c010515b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010515e:	99                   	cltd   
c010515f:	83 ec 04             	sub    $0x4,%esp
c0105162:	52                   	push   %edx
c0105163:	50                   	push   %eax
c0105164:	68 e9 98 10 c0       	push   $0xc01098e9
c0105169:	e8 3c b1 ff ff       	call   c01002aa <cprintf>
c010516e:	83 c4 10             	add    $0x10,%esp
    return page;
c0105171:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0105174:	c9                   	leave  
c0105175:	c3                   	ret    

c0105176 <_add_free_block>:

/**
 * first fit 中的放回算法
 */
void
_add_free_block(struct Page *_block) {
c0105176:	f3 0f 1e fb          	endbr32 
c010517a:	55                   	push   %ebp
c010517b:	89 e5                	mov    %esp,%ebp
c010517d:	53                   	push   %ebx
c010517e:	83 ec 44             	sub    $0x44,%esp
c0105181:	c7 45 ec e4 60 12 c0 	movl   $0xc01260e4,-0x14(%ebp)
    return list->next == list;
c0105188:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010518b:	8b 40 04             	mov    0x4(%eax),%eax
c010518e:	39 45 ec             	cmp    %eax,-0x14(%ebp)
c0105191:	0f 94 c0             	sete   %al
c0105194:	0f b6 c0             	movzbl %al,%eax
    cprintf("free list is empty :: %d \n", list_empty(&free_list));
c0105197:	83 ec 08             	sub    $0x8,%esp
c010519a:	50                   	push   %eax
c010519b:	68 fb 98 10 c0       	push   $0xc01098fb
c01051a0:	e8 05 b1 ff ff       	call   c01002aa <cprintf>
c01051a5:	83 c4 10             	add    $0x10,%esp
    list_entry_t *le = &free_list;
c01051a8:	c7 45 f4 e4 60 12 c0 	movl   $0xc01260e4,-0xc(%ebp)
    while ((le = list_next(le)) != &free_list) {
c01051af:	e9 97 00 00 00       	jmp    c010524b <_add_free_block+0xd5>
        struct Page *p = le2page(le, page_link);
c01051b4:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01051b7:	83 e8 0c             	sub    $0xc,%eax
c01051ba:	89 45 f0             	mov    %eax,-0x10(%ebp)
        cprintf("try to put block: %lx before : %lx\n", _block, p);
c01051bd:	83 ec 04             	sub    $0x4,%esp
c01051c0:	ff 75 f0             	pushl  -0x10(%ebp)
c01051c3:	ff 75 08             	pushl  0x8(%ebp)
c01051c6:	68 18 99 10 c0       	push   $0xc0109918
c01051cb:	e8 da b0 ff ff       	call   c01002aa <cprintf>
c01051d0:	83 c4 10             	add    $0x10,%esp
        if(p > _block){
c01051d3:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01051d6:	3b 45 08             	cmp    0x8(%ebp),%eax
c01051d9:	76 70                	jbe    c010524b <_add_free_block+0xd5>
            list_add_before(&p->page_link, &_block->page_link);
c01051db:	8b 45 08             	mov    0x8(%ebp),%eax
c01051de:	83 c0 0c             	add    $0xc,%eax
c01051e1:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01051e4:	83 c2 0c             	add    $0xc,%edx
c01051e7:	89 55 e8             	mov    %edx,-0x18(%ebp)
c01051ea:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    __list_add(elm, listelm->prev, listelm);
c01051ed:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01051f0:	8b 00                	mov    (%eax),%eax
c01051f2:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c01051f5:	89 55 e0             	mov    %edx,-0x20(%ebp)
c01051f8:	89 45 dc             	mov    %eax,-0x24(%ebp)
c01051fb:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01051fe:	89 45 d8             	mov    %eax,-0x28(%ebp)
    prev->next = next->prev = elm;
c0105201:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0105204:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0105207:	89 10                	mov    %edx,(%eax)
c0105209:	8b 45 d8             	mov    -0x28(%ebp),%eax
c010520c:	8b 10                	mov    (%eax),%edx
c010520e:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0105211:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0105214:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105217:	8b 55 d8             	mov    -0x28(%ebp),%edx
c010521a:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c010521d:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105220:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0105223:	89 10                	mov    %edx,(%eax)
}
c0105225:	90                   	nop
}
c0105226:	90                   	nop
            cprintf("add block: %lx before : %lx\n", (uint64_t)_block, (uint64_t)p);
c0105227:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010522a:	89 c1                	mov    %eax,%ecx
c010522c:	89 c3                	mov    %eax,%ebx
c010522e:	c1 fb 1f             	sar    $0x1f,%ebx
c0105231:	8b 45 08             	mov    0x8(%ebp),%eax
c0105234:	99                   	cltd   
c0105235:	83 ec 0c             	sub    $0xc,%esp
c0105238:	53                   	push   %ebx
c0105239:	51                   	push   %ecx
c010523a:	52                   	push   %edx
c010523b:	50                   	push   %eax
c010523c:	68 3c 99 10 c0       	push   $0xc010993c
c0105241:	e8 64 b0 ff ff       	call   c01002aa <cprintf>
c0105246:	83 c4 20             	add    $0x20,%esp
            return;
c0105249:	eb 7c                	jmp    c01052c7 <_add_free_block+0x151>
c010524b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010524e:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    return listelm->next;
c0105251:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0105254:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &free_list) {
c0105257:	89 45 f4             	mov    %eax,-0xc(%ebp)
c010525a:	81 7d f4 e4 60 12 c0 	cmpl   $0xc01260e4,-0xc(%ebp)
c0105261:	0f 85 4d ff ff ff    	jne    c01051b4 <_add_free_block+0x3e>
        }
    }
    cprintf("add block: %lx to end\n", (uint64_t)_block);
c0105267:	8b 45 08             	mov    0x8(%ebp),%eax
c010526a:	99                   	cltd   
c010526b:	83 ec 04             	sub    $0x4,%esp
c010526e:	52                   	push   %edx
c010526f:	50                   	push   %eax
c0105270:	68 59 99 10 c0       	push   $0xc0109959
c0105275:	e8 30 b0 ff ff       	call   c01002aa <cprintf>
c010527a:	83 c4 10             	add    $0x10,%esp
    // 如果最后都没有找到，那么说明他就是最后一个，那么就直接放到最后
    list_add_before(&free_list, &_block->page_link);
c010527d:	8b 45 08             	mov    0x8(%ebp),%eax
c0105280:	83 c0 0c             	add    $0xc,%eax
c0105283:	c7 45 d0 e4 60 12 c0 	movl   $0xc01260e4,-0x30(%ebp)
c010528a:	89 45 cc             	mov    %eax,-0x34(%ebp)
    __list_add(elm, listelm->prev, listelm);
c010528d:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0105290:	8b 00                	mov    (%eax),%eax
c0105292:	8b 55 cc             	mov    -0x34(%ebp),%edx
c0105295:	89 55 c8             	mov    %edx,-0x38(%ebp)
c0105298:	89 45 c4             	mov    %eax,-0x3c(%ebp)
c010529b:	8b 45 d0             	mov    -0x30(%ebp),%eax
c010529e:	89 45 c0             	mov    %eax,-0x40(%ebp)
    prev->next = next->prev = elm;
c01052a1:	8b 45 c0             	mov    -0x40(%ebp),%eax
c01052a4:	8b 55 c8             	mov    -0x38(%ebp),%edx
c01052a7:	89 10                	mov    %edx,(%eax)
c01052a9:	8b 45 c0             	mov    -0x40(%ebp),%eax
c01052ac:	8b 10                	mov    (%eax),%edx
c01052ae:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c01052b1:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c01052b4:	8b 45 c8             	mov    -0x38(%ebp),%eax
c01052b7:	8b 55 c0             	mov    -0x40(%ebp),%edx
c01052ba:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c01052bd:	8b 45 c8             	mov    -0x38(%ebp),%eax
c01052c0:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c01052c3:	89 10                	mov    %edx,(%eax)
}
c01052c5:	90                   	nop
}
c01052c6:	90                   	nop
}
c01052c7:	8b 5d fc             	mov    -0x4(%ebp),%ebx
c01052ca:	c9                   	leave  
c01052cb:	c3                   	ret    

c01052cc <default_free_pages>:

static void
default_free_pages(struct Page *base, size_t n) {
c01052cc:	f3 0f 1e fb          	endbr32 
c01052d0:	55                   	push   %ebp
c01052d1:	89 e5                	mov    %esp,%ebp
c01052d3:	83 ec 68             	sub    $0x68,%esp
    assert(n > 0);
c01052d6:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c01052da:	75 19                	jne    c01052f5 <default_free_pages+0x29>
c01052dc:	68 30 98 10 c0       	push   $0xc0109830
c01052e1:	68 36 98 10 c0       	push   $0xc0109836
c01052e6:	68 b8 00 00 00       	push   $0xb8
c01052eb:	68 4b 98 10 c0       	push   $0xc010984b
c01052f0:	e8 30 b1 ff ff       	call   c0100425 <__panic>
    struct Page *p = base;
c01052f5:	8b 45 08             	mov    0x8(%ebp),%eax
c01052f8:	89 45 f4             	mov    %eax,-0xc(%ebp)
    for (; p != base + n; p ++) {
c01052fb:	e9 8f 00 00 00       	jmp    c010538f <default_free_pages+0xc3>
        assert(!PageReserved(p) && !PageProperty(p));
c0105300:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105303:	83 c0 04             	add    $0x4,%eax
c0105306:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
c010530d:	89 45 e8             	mov    %eax,-0x18(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0105310:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105313:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0105316:	0f a3 10             	bt     %edx,(%eax)
c0105319:	19 c0                	sbb    %eax,%eax
c010531b:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    return oldbit != 0;
c010531e:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c0105322:	0f 95 c0             	setne  %al
c0105325:	0f b6 c0             	movzbl %al,%eax
c0105328:	85 c0                	test   %eax,%eax
c010532a:	75 2c                	jne    c0105358 <default_free_pages+0x8c>
c010532c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010532f:	83 c0 04             	add    $0x4,%eax
c0105332:	c7 45 e0 01 00 00 00 	movl   $0x1,-0x20(%ebp)
c0105339:	89 45 dc             	mov    %eax,-0x24(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c010533c:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010533f:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0105342:	0f a3 10             	bt     %edx,(%eax)
c0105345:	19 c0                	sbb    %eax,%eax
c0105347:	89 45 d8             	mov    %eax,-0x28(%ebp)
    return oldbit != 0;
c010534a:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
c010534e:	0f 95 c0             	setne  %al
c0105351:	0f b6 c0             	movzbl %al,%eax
c0105354:	85 c0                	test   %eax,%eax
c0105356:	74 19                	je     c0105371 <default_free_pages+0xa5>
c0105358:	68 70 99 10 c0       	push   $0xc0109970
c010535d:	68 36 98 10 c0       	push   $0xc0109836
c0105362:	68 bb 00 00 00       	push   $0xbb
c0105367:	68 4b 98 10 c0       	push   $0xc010984b
c010536c:	e8 b4 b0 ff ff       	call   c0100425 <__panic>
        p->flags = 0;
c0105371:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105374:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
        set_page_ref(p, 0);
c010537b:	83 ec 08             	sub    $0x8,%esp
c010537e:	6a 00                	push   $0x0
c0105380:	ff 75 f4             	pushl  -0xc(%ebp)
c0105383:	e8 c6 fa ff ff       	call   c0104e4e <set_page_ref>
c0105388:	83 c4 10             	add    $0x10,%esp
    for (; p != base + n; p ++) {
c010538b:	83 45 f4 20          	addl   $0x20,-0xc(%ebp)
c010538f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105392:	c1 e0 05             	shl    $0x5,%eax
c0105395:	89 c2                	mov    %eax,%edx
c0105397:	8b 45 08             	mov    0x8(%ebp),%eax
c010539a:	01 d0                	add    %edx,%eax
c010539c:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c010539f:	0f 85 5b ff ff ff    	jne    c0105300 <default_free_pages+0x34>
    }
    base->property = n;
c01053a5:	8b 45 08             	mov    0x8(%ebp),%eax
c01053a8:	8b 55 0c             	mov    0xc(%ebp),%edx
c01053ab:	89 50 08             	mov    %edx,0x8(%eax)
    SetPageProperty(base);
c01053ae:	8b 45 08             	mov    0x8(%ebp),%eax
c01053b1:	83 c0 04             	add    $0x4,%eax
c01053b4:	c7 45 d0 01 00 00 00 	movl   $0x1,-0x30(%ebp)
c01053bb:	89 45 cc             	mov    %eax,-0x34(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c01053be:	8b 45 cc             	mov    -0x34(%ebp),%eax
c01053c1:	8b 55 d0             	mov    -0x30(%ebp),%edx
c01053c4:	0f ab 10             	bts    %edx,(%eax)
}
c01053c7:	90                   	nop
c01053c8:	c7 45 d4 e4 60 12 c0 	movl   $0xc01260e4,-0x2c(%ebp)
    return listelm->next;
c01053cf:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01053d2:	8b 40 04             	mov    0x4(%eax),%eax
    list_entry_t *le = list_next(&free_list);
c01053d5:	89 45 f0             	mov    %eax,-0x10(%ebp)
    while (le != &free_list) {
c01053d8:	e9 00 01 00 00       	jmp    c01054dd <default_free_pages+0x211>
        p = le2page(le, page_link);
c01053dd:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01053e0:	83 e8 0c             	sub    $0xc,%eax
c01053e3:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01053e6:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01053e9:	89 45 c8             	mov    %eax,-0x38(%ebp)
c01053ec:	8b 45 c8             	mov    -0x38(%ebp),%eax
c01053ef:	8b 40 04             	mov    0x4(%eax),%eax
        le = list_next(le);
c01053f2:	89 45 f0             	mov    %eax,-0x10(%ebp)
        if (base + base->property == p) {
c01053f5:	8b 45 08             	mov    0x8(%ebp),%eax
c01053f8:	8b 40 08             	mov    0x8(%eax),%eax
c01053fb:	c1 e0 05             	shl    $0x5,%eax
c01053fe:	89 c2                	mov    %eax,%edx
c0105400:	8b 45 08             	mov    0x8(%ebp),%eax
c0105403:	01 d0                	add    %edx,%eax
c0105405:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0105408:	75 5d                	jne    c0105467 <default_free_pages+0x19b>
            base->property += p->property;
c010540a:	8b 45 08             	mov    0x8(%ebp),%eax
c010540d:	8b 50 08             	mov    0x8(%eax),%edx
c0105410:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105413:	8b 40 08             	mov    0x8(%eax),%eax
c0105416:	01 c2                	add    %eax,%edx
c0105418:	8b 45 08             	mov    0x8(%ebp),%eax
c010541b:	89 50 08             	mov    %edx,0x8(%eax)
            ClearPageProperty(p);
c010541e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105421:	83 c0 04             	add    $0x4,%eax
c0105424:	c7 45 b8 01 00 00 00 	movl   $0x1,-0x48(%ebp)
c010542b:	89 45 b4             	mov    %eax,-0x4c(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c010542e:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c0105431:	8b 55 b8             	mov    -0x48(%ebp),%edx
c0105434:	0f b3 10             	btr    %edx,(%eax)
}
c0105437:	90                   	nop
            list_del(&(p->page_link));
c0105438:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010543b:	83 c0 0c             	add    $0xc,%eax
c010543e:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    __list_del(listelm->prev, listelm->next);
c0105441:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0105444:	8b 40 04             	mov    0x4(%eax),%eax
c0105447:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c010544a:	8b 12                	mov    (%edx),%edx
c010544c:	89 55 c0             	mov    %edx,-0x40(%ebp)
c010544f:	89 45 bc             	mov    %eax,-0x44(%ebp)
    prev->next = next;
c0105452:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0105455:	8b 55 bc             	mov    -0x44(%ebp),%edx
c0105458:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c010545b:	8b 45 bc             	mov    -0x44(%ebp),%eax
c010545e:	8b 55 c0             	mov    -0x40(%ebp),%edx
c0105461:	89 10                	mov    %edx,(%eax)
}
c0105463:	90                   	nop
}
c0105464:	90                   	nop
c0105465:	eb 76                	jmp    c01054dd <default_free_pages+0x211>
        }
        else if (p + p->property == base) {
c0105467:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010546a:	8b 40 08             	mov    0x8(%eax),%eax
c010546d:	c1 e0 05             	shl    $0x5,%eax
c0105470:	89 c2                	mov    %eax,%edx
c0105472:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105475:	01 d0                	add    %edx,%eax
c0105477:	39 45 08             	cmp    %eax,0x8(%ebp)
c010547a:	75 61                	jne    c01054dd <default_free_pages+0x211>
            p->property += base->property;
c010547c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010547f:	8b 50 08             	mov    0x8(%eax),%edx
c0105482:	8b 45 08             	mov    0x8(%ebp),%eax
c0105485:	8b 40 08             	mov    0x8(%eax),%eax
c0105488:	01 c2                	add    %eax,%edx
c010548a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010548d:	89 50 08             	mov    %edx,0x8(%eax)
            ClearPageProperty(base);
c0105490:	8b 45 08             	mov    0x8(%ebp),%eax
c0105493:	83 c0 04             	add    $0x4,%eax
c0105496:	c7 45 a4 01 00 00 00 	movl   $0x1,-0x5c(%ebp)
c010549d:	89 45 a0             	mov    %eax,-0x60(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c01054a0:	8b 45 a0             	mov    -0x60(%ebp),%eax
c01054a3:	8b 55 a4             	mov    -0x5c(%ebp),%edx
c01054a6:	0f b3 10             	btr    %edx,(%eax)
}
c01054a9:	90                   	nop
            base = p;
c01054aa:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01054ad:	89 45 08             	mov    %eax,0x8(%ebp)
            list_del(&(p->page_link));
c01054b0:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01054b3:	83 c0 0c             	add    $0xc,%eax
c01054b6:	89 45 b0             	mov    %eax,-0x50(%ebp)
    __list_del(listelm->prev, listelm->next);
c01054b9:	8b 45 b0             	mov    -0x50(%ebp),%eax
c01054bc:	8b 40 04             	mov    0x4(%eax),%eax
c01054bf:	8b 55 b0             	mov    -0x50(%ebp),%edx
c01054c2:	8b 12                	mov    (%edx),%edx
c01054c4:	89 55 ac             	mov    %edx,-0x54(%ebp)
c01054c7:	89 45 a8             	mov    %eax,-0x58(%ebp)
    prev->next = next;
c01054ca:	8b 45 ac             	mov    -0x54(%ebp),%eax
c01054cd:	8b 55 a8             	mov    -0x58(%ebp),%edx
c01054d0:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c01054d3:	8b 45 a8             	mov    -0x58(%ebp),%eax
c01054d6:	8b 55 ac             	mov    -0x54(%ebp),%edx
c01054d9:	89 10                	mov    %edx,(%eax)
}
c01054db:	90                   	nop
}
c01054dc:	90                   	nop
    while (le != &free_list) {
c01054dd:	81 7d f0 e4 60 12 c0 	cmpl   $0xc01260e4,-0x10(%ebp)
c01054e4:	0f 85 f3 fe ff ff    	jne    c01053dd <default_free_pages+0x111>
        }
    }
    nr_free += n;
c01054ea:	8b 15 ec 60 12 c0    	mov    0xc01260ec,%edx
c01054f0:	8b 45 0c             	mov    0xc(%ebp),%eax
c01054f3:	01 d0                	add    %edx,%eax
c01054f5:	a3 ec 60 12 c0       	mov    %eax,0xc01260ec
    _add_free_block(base);
c01054fa:	83 ec 0c             	sub    $0xc,%esp
c01054fd:	ff 75 08             	pushl  0x8(%ebp)
c0105500:	e8 71 fc ff ff       	call   c0105176 <_add_free_block>
c0105505:	83 c4 10             	add    $0x10,%esp
}
c0105508:	90                   	nop
c0105509:	c9                   	leave  
c010550a:	c3                   	ret    

c010550b <default_nr_free_pages>:

static size_t
default_nr_free_pages(void) {
c010550b:	f3 0f 1e fb          	endbr32 
c010550f:	55                   	push   %ebp
c0105510:	89 e5                	mov    %esp,%ebp
    return nr_free;
c0105512:	a1 ec 60 12 c0       	mov    0xc01260ec,%eax
}
c0105517:	5d                   	pop    %ebp
c0105518:	c3                   	ret    

c0105519 <basic_check>:

static void
basic_check(void) {
c0105519:	f3 0f 1e fb          	endbr32 
c010551d:	55                   	push   %ebp
c010551e:	89 e5                	mov    %esp,%ebp
c0105520:	83 ec 38             	sub    $0x38,%esp
    struct Page *p0, *p1, *p2;
    p0 = p1 = p2 = NULL;
c0105523:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c010552a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010552d:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105530:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105533:	89 45 ec             	mov    %eax,-0x14(%ebp)
    assert((p0 = alloc_page()) != NULL);
c0105536:	83 ec 0c             	sub    $0xc,%esp
c0105539:	6a 01                	push   $0x1
c010553b:	e8 0b 0d 00 00       	call   c010624b <alloc_pages>
c0105540:	83 c4 10             	add    $0x10,%esp
c0105543:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0105546:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c010554a:	75 19                	jne    c0105565 <basic_check+0x4c>
c010554c:	68 95 99 10 c0       	push   $0xc0109995
c0105551:	68 36 98 10 c0       	push   $0xc0109836
c0105556:	68 de 00 00 00       	push   $0xde
c010555b:	68 4b 98 10 c0       	push   $0xc010984b
c0105560:	e8 c0 ae ff ff       	call   c0100425 <__panic>
    assert((p1 = alloc_page()) != NULL);
c0105565:	83 ec 0c             	sub    $0xc,%esp
c0105568:	6a 01                	push   $0x1
c010556a:	e8 dc 0c 00 00       	call   c010624b <alloc_pages>
c010556f:	83 c4 10             	add    $0x10,%esp
c0105572:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105575:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0105579:	75 19                	jne    c0105594 <basic_check+0x7b>
c010557b:	68 b1 99 10 c0       	push   $0xc01099b1
c0105580:	68 36 98 10 c0       	push   $0xc0109836
c0105585:	68 df 00 00 00       	push   $0xdf
c010558a:	68 4b 98 10 c0       	push   $0xc010984b
c010558f:	e8 91 ae ff ff       	call   c0100425 <__panic>
    assert((p2 = alloc_page()) != NULL);
c0105594:	83 ec 0c             	sub    $0xc,%esp
c0105597:	6a 01                	push   $0x1
c0105599:	e8 ad 0c 00 00       	call   c010624b <alloc_pages>
c010559e:	83 c4 10             	add    $0x10,%esp
c01055a1:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01055a4:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01055a8:	75 19                	jne    c01055c3 <basic_check+0xaa>
c01055aa:	68 cd 99 10 c0       	push   $0xc01099cd
c01055af:	68 36 98 10 c0       	push   $0xc0109836
c01055b4:	68 e0 00 00 00       	push   $0xe0
c01055b9:	68 4b 98 10 c0       	push   $0xc010984b
c01055be:	e8 62 ae ff ff       	call   c0100425 <__panic>

    assert(p0 != p1 && p0 != p2 && p1 != p2);
c01055c3:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01055c6:	3b 45 f0             	cmp    -0x10(%ebp),%eax
c01055c9:	74 10                	je     c01055db <basic_check+0xc2>
c01055cb:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01055ce:	3b 45 f4             	cmp    -0xc(%ebp),%eax
c01055d1:	74 08                	je     c01055db <basic_check+0xc2>
c01055d3:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01055d6:	3b 45 f4             	cmp    -0xc(%ebp),%eax
c01055d9:	75 19                	jne    c01055f4 <basic_check+0xdb>
c01055db:	68 ec 99 10 c0       	push   $0xc01099ec
c01055e0:	68 36 98 10 c0       	push   $0xc0109836
c01055e5:	68 e2 00 00 00       	push   $0xe2
c01055ea:	68 4b 98 10 c0       	push   $0xc010984b
c01055ef:	e8 31 ae ff ff       	call   c0100425 <__panic>
    assert(page_ref(p0) == 0 && page_ref(p1) == 0 && page_ref(p2) == 0);
c01055f4:	83 ec 0c             	sub    $0xc,%esp
c01055f7:	ff 75 ec             	pushl  -0x14(%ebp)
c01055fa:	e8 45 f8 ff ff       	call   c0104e44 <page_ref>
c01055ff:	83 c4 10             	add    $0x10,%esp
c0105602:	85 c0                	test   %eax,%eax
c0105604:	75 24                	jne    c010562a <basic_check+0x111>
c0105606:	83 ec 0c             	sub    $0xc,%esp
c0105609:	ff 75 f0             	pushl  -0x10(%ebp)
c010560c:	e8 33 f8 ff ff       	call   c0104e44 <page_ref>
c0105611:	83 c4 10             	add    $0x10,%esp
c0105614:	85 c0                	test   %eax,%eax
c0105616:	75 12                	jne    c010562a <basic_check+0x111>
c0105618:	83 ec 0c             	sub    $0xc,%esp
c010561b:	ff 75 f4             	pushl  -0xc(%ebp)
c010561e:	e8 21 f8 ff ff       	call   c0104e44 <page_ref>
c0105623:	83 c4 10             	add    $0x10,%esp
c0105626:	85 c0                	test   %eax,%eax
c0105628:	74 19                	je     c0105643 <basic_check+0x12a>
c010562a:	68 10 9a 10 c0       	push   $0xc0109a10
c010562f:	68 36 98 10 c0       	push   $0xc0109836
c0105634:	68 e3 00 00 00       	push   $0xe3
c0105639:	68 4b 98 10 c0       	push   $0xc010984b
c010563e:	e8 e2 ad ff ff       	call   c0100425 <__panic>

    assert(page2pa(p0) < npage * PGSIZE);
c0105643:	83 ec 0c             	sub    $0xc,%esp
c0105646:	ff 75 ec             	pushl  -0x14(%ebp)
c0105649:	e8 e3 f7 ff ff       	call   c0104e31 <page2pa>
c010564e:	83 c4 10             	add    $0x10,%esp
c0105651:	8b 15 80 5f 12 c0    	mov    0xc0125f80,%edx
c0105657:	c1 e2 0c             	shl    $0xc,%edx
c010565a:	39 d0                	cmp    %edx,%eax
c010565c:	72 19                	jb     c0105677 <basic_check+0x15e>
c010565e:	68 4c 9a 10 c0       	push   $0xc0109a4c
c0105663:	68 36 98 10 c0       	push   $0xc0109836
c0105668:	68 e5 00 00 00       	push   $0xe5
c010566d:	68 4b 98 10 c0       	push   $0xc010984b
c0105672:	e8 ae ad ff ff       	call   c0100425 <__panic>
    assert(page2pa(p1) < npage * PGSIZE);
c0105677:	83 ec 0c             	sub    $0xc,%esp
c010567a:	ff 75 f0             	pushl  -0x10(%ebp)
c010567d:	e8 af f7 ff ff       	call   c0104e31 <page2pa>
c0105682:	83 c4 10             	add    $0x10,%esp
c0105685:	8b 15 80 5f 12 c0    	mov    0xc0125f80,%edx
c010568b:	c1 e2 0c             	shl    $0xc,%edx
c010568e:	39 d0                	cmp    %edx,%eax
c0105690:	72 19                	jb     c01056ab <basic_check+0x192>
c0105692:	68 69 9a 10 c0       	push   $0xc0109a69
c0105697:	68 36 98 10 c0       	push   $0xc0109836
c010569c:	68 e6 00 00 00       	push   $0xe6
c01056a1:	68 4b 98 10 c0       	push   $0xc010984b
c01056a6:	e8 7a ad ff ff       	call   c0100425 <__panic>
    assert(page2pa(p2) < npage * PGSIZE);
c01056ab:	83 ec 0c             	sub    $0xc,%esp
c01056ae:	ff 75 f4             	pushl  -0xc(%ebp)
c01056b1:	e8 7b f7 ff ff       	call   c0104e31 <page2pa>
c01056b6:	83 c4 10             	add    $0x10,%esp
c01056b9:	8b 15 80 5f 12 c0    	mov    0xc0125f80,%edx
c01056bf:	c1 e2 0c             	shl    $0xc,%edx
c01056c2:	39 d0                	cmp    %edx,%eax
c01056c4:	72 19                	jb     c01056df <basic_check+0x1c6>
c01056c6:	68 86 9a 10 c0       	push   $0xc0109a86
c01056cb:	68 36 98 10 c0       	push   $0xc0109836
c01056d0:	68 e7 00 00 00       	push   $0xe7
c01056d5:	68 4b 98 10 c0       	push   $0xc010984b
c01056da:	e8 46 ad ff ff       	call   c0100425 <__panic>

    list_entry_t free_list_store = free_list;
c01056df:	a1 e4 60 12 c0       	mov    0xc01260e4,%eax
c01056e4:	8b 15 e8 60 12 c0    	mov    0xc01260e8,%edx
c01056ea:	89 45 d0             	mov    %eax,-0x30(%ebp)
c01056ed:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c01056f0:	c7 45 dc e4 60 12 c0 	movl   $0xc01260e4,-0x24(%ebp)
    elm->prev = elm->next = elm;
c01056f7:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01056fa:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01056fd:	89 50 04             	mov    %edx,0x4(%eax)
c0105700:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0105703:	8b 50 04             	mov    0x4(%eax),%edx
c0105706:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0105709:	89 10                	mov    %edx,(%eax)
}
c010570b:	90                   	nop
c010570c:	c7 45 e0 e4 60 12 c0 	movl   $0xc01260e4,-0x20(%ebp)
    return list->next == list;
c0105713:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105716:	8b 40 04             	mov    0x4(%eax),%eax
c0105719:	39 45 e0             	cmp    %eax,-0x20(%ebp)
c010571c:	0f 94 c0             	sete   %al
c010571f:	0f b6 c0             	movzbl %al,%eax
    list_init(&free_list);
    assert(list_empty(&free_list));
c0105722:	85 c0                	test   %eax,%eax
c0105724:	75 19                	jne    c010573f <basic_check+0x226>
c0105726:	68 a3 9a 10 c0       	push   $0xc0109aa3
c010572b:	68 36 98 10 c0       	push   $0xc0109836
c0105730:	68 eb 00 00 00       	push   $0xeb
c0105735:	68 4b 98 10 c0       	push   $0xc010984b
c010573a:	e8 e6 ac ff ff       	call   c0100425 <__panic>

    unsigned int nr_free_store = nr_free;
c010573f:	a1 ec 60 12 c0       	mov    0xc01260ec,%eax
c0105744:	89 45 e8             	mov    %eax,-0x18(%ebp)
    nr_free = 0;
c0105747:	c7 05 ec 60 12 c0 00 	movl   $0x0,0xc01260ec
c010574e:	00 00 00 

    assert(alloc_page() == NULL);
c0105751:	83 ec 0c             	sub    $0xc,%esp
c0105754:	6a 01                	push   $0x1
c0105756:	e8 f0 0a 00 00       	call   c010624b <alloc_pages>
c010575b:	83 c4 10             	add    $0x10,%esp
c010575e:	85 c0                	test   %eax,%eax
c0105760:	74 19                	je     c010577b <basic_check+0x262>
c0105762:	68 ba 9a 10 c0       	push   $0xc0109aba
c0105767:	68 36 98 10 c0       	push   $0xc0109836
c010576c:	68 f0 00 00 00       	push   $0xf0
c0105771:	68 4b 98 10 c0       	push   $0xc010984b
c0105776:	e8 aa ac ff ff       	call   c0100425 <__panic>

    free_page(p0);
c010577b:	83 ec 08             	sub    $0x8,%esp
c010577e:	6a 01                	push   $0x1
c0105780:	ff 75 ec             	pushl  -0x14(%ebp)
c0105783:	e8 33 0b 00 00       	call   c01062bb <free_pages>
c0105788:	83 c4 10             	add    $0x10,%esp
    free_page(p1);
c010578b:	83 ec 08             	sub    $0x8,%esp
c010578e:	6a 01                	push   $0x1
c0105790:	ff 75 f0             	pushl  -0x10(%ebp)
c0105793:	e8 23 0b 00 00       	call   c01062bb <free_pages>
c0105798:	83 c4 10             	add    $0x10,%esp
    free_page(p2);
c010579b:	83 ec 08             	sub    $0x8,%esp
c010579e:	6a 01                	push   $0x1
c01057a0:	ff 75 f4             	pushl  -0xc(%ebp)
c01057a3:	e8 13 0b 00 00       	call   c01062bb <free_pages>
c01057a8:	83 c4 10             	add    $0x10,%esp
    assert(nr_free == 3);
c01057ab:	a1 ec 60 12 c0       	mov    0xc01260ec,%eax
c01057b0:	83 f8 03             	cmp    $0x3,%eax
c01057b3:	74 19                	je     c01057ce <basic_check+0x2b5>
c01057b5:	68 cf 9a 10 c0       	push   $0xc0109acf
c01057ba:	68 36 98 10 c0       	push   $0xc0109836
c01057bf:	68 f5 00 00 00       	push   $0xf5
c01057c4:	68 4b 98 10 c0       	push   $0xc010984b
c01057c9:	e8 57 ac ff ff       	call   c0100425 <__panic>

    assert((p0 = alloc_page()) != NULL);
c01057ce:	83 ec 0c             	sub    $0xc,%esp
c01057d1:	6a 01                	push   $0x1
c01057d3:	e8 73 0a 00 00       	call   c010624b <alloc_pages>
c01057d8:	83 c4 10             	add    $0x10,%esp
c01057db:	89 45 ec             	mov    %eax,-0x14(%ebp)
c01057de:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c01057e2:	75 19                	jne    c01057fd <basic_check+0x2e4>
c01057e4:	68 95 99 10 c0       	push   $0xc0109995
c01057e9:	68 36 98 10 c0       	push   $0xc0109836
c01057ee:	68 f7 00 00 00       	push   $0xf7
c01057f3:	68 4b 98 10 c0       	push   $0xc010984b
c01057f8:	e8 28 ac ff ff       	call   c0100425 <__panic>
    assert((p1 = alloc_page()) != NULL);
c01057fd:	83 ec 0c             	sub    $0xc,%esp
c0105800:	6a 01                	push   $0x1
c0105802:	e8 44 0a 00 00       	call   c010624b <alloc_pages>
c0105807:	83 c4 10             	add    $0x10,%esp
c010580a:	89 45 f0             	mov    %eax,-0x10(%ebp)
c010580d:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0105811:	75 19                	jne    c010582c <basic_check+0x313>
c0105813:	68 b1 99 10 c0       	push   $0xc01099b1
c0105818:	68 36 98 10 c0       	push   $0xc0109836
c010581d:	68 f8 00 00 00       	push   $0xf8
c0105822:	68 4b 98 10 c0       	push   $0xc010984b
c0105827:	e8 f9 ab ff ff       	call   c0100425 <__panic>
    assert((p2 = alloc_page()) != NULL);
c010582c:	83 ec 0c             	sub    $0xc,%esp
c010582f:	6a 01                	push   $0x1
c0105831:	e8 15 0a 00 00       	call   c010624b <alloc_pages>
c0105836:	83 c4 10             	add    $0x10,%esp
c0105839:	89 45 f4             	mov    %eax,-0xc(%ebp)
c010583c:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0105840:	75 19                	jne    c010585b <basic_check+0x342>
c0105842:	68 cd 99 10 c0       	push   $0xc01099cd
c0105847:	68 36 98 10 c0       	push   $0xc0109836
c010584c:	68 f9 00 00 00       	push   $0xf9
c0105851:	68 4b 98 10 c0       	push   $0xc010984b
c0105856:	e8 ca ab ff ff       	call   c0100425 <__panic>

    assert(alloc_page() == NULL);
c010585b:	83 ec 0c             	sub    $0xc,%esp
c010585e:	6a 01                	push   $0x1
c0105860:	e8 e6 09 00 00       	call   c010624b <alloc_pages>
c0105865:	83 c4 10             	add    $0x10,%esp
c0105868:	85 c0                	test   %eax,%eax
c010586a:	74 19                	je     c0105885 <basic_check+0x36c>
c010586c:	68 ba 9a 10 c0       	push   $0xc0109aba
c0105871:	68 36 98 10 c0       	push   $0xc0109836
c0105876:	68 fb 00 00 00       	push   $0xfb
c010587b:	68 4b 98 10 c0       	push   $0xc010984b
c0105880:	e8 a0 ab ff ff       	call   c0100425 <__panic>

    free_page(p0);
c0105885:	83 ec 08             	sub    $0x8,%esp
c0105888:	6a 01                	push   $0x1
c010588a:	ff 75 ec             	pushl  -0x14(%ebp)
c010588d:	e8 29 0a 00 00       	call   c01062bb <free_pages>
c0105892:	83 c4 10             	add    $0x10,%esp
c0105895:	c7 45 d8 e4 60 12 c0 	movl   $0xc01260e4,-0x28(%ebp)
c010589c:	8b 45 d8             	mov    -0x28(%ebp),%eax
c010589f:	8b 40 04             	mov    0x4(%eax),%eax
c01058a2:	39 45 d8             	cmp    %eax,-0x28(%ebp)
c01058a5:	0f 94 c0             	sete   %al
c01058a8:	0f b6 c0             	movzbl %al,%eax
    assert(!list_empty(&free_list));
c01058ab:	85 c0                	test   %eax,%eax
c01058ad:	74 19                	je     c01058c8 <basic_check+0x3af>
c01058af:	68 dc 9a 10 c0       	push   $0xc0109adc
c01058b4:	68 36 98 10 c0       	push   $0xc0109836
c01058b9:	68 fe 00 00 00       	push   $0xfe
c01058be:	68 4b 98 10 c0       	push   $0xc010984b
c01058c3:	e8 5d ab ff ff       	call   c0100425 <__panic>

    struct Page *p;
    assert((p = alloc_page()) == p0);
c01058c8:	83 ec 0c             	sub    $0xc,%esp
c01058cb:	6a 01                	push   $0x1
c01058cd:	e8 79 09 00 00       	call   c010624b <alloc_pages>
c01058d2:	83 c4 10             	add    $0x10,%esp
c01058d5:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c01058d8:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01058db:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c01058de:	74 19                	je     c01058f9 <basic_check+0x3e0>
c01058e0:	68 f4 9a 10 c0       	push   $0xc0109af4
c01058e5:	68 36 98 10 c0       	push   $0xc0109836
c01058ea:	68 01 01 00 00       	push   $0x101
c01058ef:	68 4b 98 10 c0       	push   $0xc010984b
c01058f4:	e8 2c ab ff ff       	call   c0100425 <__panic>
    assert(alloc_page() == NULL);
c01058f9:	83 ec 0c             	sub    $0xc,%esp
c01058fc:	6a 01                	push   $0x1
c01058fe:	e8 48 09 00 00       	call   c010624b <alloc_pages>
c0105903:	83 c4 10             	add    $0x10,%esp
c0105906:	85 c0                	test   %eax,%eax
c0105908:	74 19                	je     c0105923 <basic_check+0x40a>
c010590a:	68 ba 9a 10 c0       	push   $0xc0109aba
c010590f:	68 36 98 10 c0       	push   $0xc0109836
c0105914:	68 02 01 00 00       	push   $0x102
c0105919:	68 4b 98 10 c0       	push   $0xc010984b
c010591e:	e8 02 ab ff ff       	call   c0100425 <__panic>

    assert(nr_free == 0);
c0105923:	a1 ec 60 12 c0       	mov    0xc01260ec,%eax
c0105928:	85 c0                	test   %eax,%eax
c010592a:	74 19                	je     c0105945 <basic_check+0x42c>
c010592c:	68 0d 9b 10 c0       	push   $0xc0109b0d
c0105931:	68 36 98 10 c0       	push   $0xc0109836
c0105936:	68 04 01 00 00       	push   $0x104
c010593b:	68 4b 98 10 c0       	push   $0xc010984b
c0105940:	e8 e0 aa ff ff       	call   c0100425 <__panic>
    free_list = free_list_store;
c0105945:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0105948:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c010594b:	a3 e4 60 12 c0       	mov    %eax,0xc01260e4
c0105950:	89 15 e8 60 12 c0    	mov    %edx,0xc01260e8
    nr_free = nr_free_store;
c0105956:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105959:	a3 ec 60 12 c0       	mov    %eax,0xc01260ec

    free_page(p);
c010595e:	83 ec 08             	sub    $0x8,%esp
c0105961:	6a 01                	push   $0x1
c0105963:	ff 75 e4             	pushl  -0x1c(%ebp)
c0105966:	e8 50 09 00 00       	call   c01062bb <free_pages>
c010596b:	83 c4 10             	add    $0x10,%esp
    free_page(p1);
c010596e:	83 ec 08             	sub    $0x8,%esp
c0105971:	6a 01                	push   $0x1
c0105973:	ff 75 f0             	pushl  -0x10(%ebp)
c0105976:	e8 40 09 00 00       	call   c01062bb <free_pages>
c010597b:	83 c4 10             	add    $0x10,%esp
    free_page(p2);
c010597e:	83 ec 08             	sub    $0x8,%esp
c0105981:	6a 01                	push   $0x1
c0105983:	ff 75 f4             	pushl  -0xc(%ebp)
c0105986:	e8 30 09 00 00       	call   c01062bb <free_pages>
c010598b:	83 c4 10             	add    $0x10,%esp
}
c010598e:	90                   	nop
c010598f:	c9                   	leave  
c0105990:	c3                   	ret    

c0105991 <default_check>:

// LAB2: below code is used to check the first fit allocation algorithm (your EXERCISE 1) 
// NOTICE: You SHOULD NOT CHANGE basic_check, default_check functions!
static void
default_check(void) {
c0105991:	f3 0f 1e fb          	endbr32 
c0105995:	55                   	push   %ebp
c0105996:	89 e5                	mov    %esp,%ebp
c0105998:	81 ec 88 00 00 00    	sub    $0x88,%esp
    int count = 0, total = 0;
c010599e:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c01059a5:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    list_entry_t *le = &free_list;
c01059ac:	c7 45 ec e4 60 12 c0 	movl   $0xc01260e4,-0x14(%ebp)
    while ((le = list_next(le)) != &free_list) {
c01059b3:	eb 60                	jmp    c0105a15 <default_check+0x84>
        struct Page *p = le2page(le, page_link);
c01059b5:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01059b8:	83 e8 0c             	sub    $0xc,%eax
c01059bb:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        assert(PageProperty(p));
c01059be:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01059c1:	83 c0 04             	add    $0x4,%eax
c01059c4:	c7 45 d0 01 00 00 00 	movl   $0x1,-0x30(%ebp)
c01059cb:	89 45 cc             	mov    %eax,-0x34(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c01059ce:	8b 45 cc             	mov    -0x34(%ebp),%eax
c01059d1:	8b 55 d0             	mov    -0x30(%ebp),%edx
c01059d4:	0f a3 10             	bt     %edx,(%eax)
c01059d7:	19 c0                	sbb    %eax,%eax
c01059d9:	89 45 c8             	mov    %eax,-0x38(%ebp)
    return oldbit != 0;
c01059dc:	83 7d c8 00          	cmpl   $0x0,-0x38(%ebp)
c01059e0:	0f 95 c0             	setne  %al
c01059e3:	0f b6 c0             	movzbl %al,%eax
c01059e6:	85 c0                	test   %eax,%eax
c01059e8:	75 19                	jne    c0105a03 <default_check+0x72>
c01059ea:	68 1a 9b 10 c0       	push   $0xc0109b1a
c01059ef:	68 36 98 10 c0       	push   $0xc0109836
c01059f4:	68 15 01 00 00       	push   $0x115
c01059f9:	68 4b 98 10 c0       	push   $0xc010984b
c01059fe:	e8 22 aa ff ff       	call   c0100425 <__panic>
        count ++, total += p->property;
c0105a03:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c0105a07:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0105a0a:	8b 50 08             	mov    0x8(%eax),%edx
c0105a0d:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105a10:	01 d0                	add    %edx,%eax
c0105a12:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105a15:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105a18:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    return listelm->next;
c0105a1b:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0105a1e:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &free_list) {
c0105a21:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0105a24:	81 7d ec e4 60 12 c0 	cmpl   $0xc01260e4,-0x14(%ebp)
c0105a2b:	75 88                	jne    c01059b5 <default_check+0x24>
    }
    assert(total == nr_free_pages());
c0105a2d:	e8 c2 08 00 00       	call   c01062f4 <nr_free_pages>
c0105a32:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0105a35:	39 d0                	cmp    %edx,%eax
c0105a37:	74 19                	je     c0105a52 <default_check+0xc1>
c0105a39:	68 2a 9b 10 c0       	push   $0xc0109b2a
c0105a3e:	68 36 98 10 c0       	push   $0xc0109836
c0105a43:	68 18 01 00 00       	push   $0x118
c0105a48:	68 4b 98 10 c0       	push   $0xc010984b
c0105a4d:	e8 d3 a9 ff ff       	call   c0100425 <__panic>

    basic_check();
c0105a52:	e8 c2 fa ff ff       	call   c0105519 <basic_check>

    struct Page *p0 = alloc_pages(5), *p1, *p2;
c0105a57:	83 ec 0c             	sub    $0xc,%esp
c0105a5a:	6a 05                	push   $0x5
c0105a5c:	e8 ea 07 00 00       	call   c010624b <alloc_pages>
c0105a61:	83 c4 10             	add    $0x10,%esp
c0105a64:	89 45 e8             	mov    %eax,-0x18(%ebp)
    assert(p0 != NULL);
c0105a67:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0105a6b:	75 19                	jne    c0105a86 <default_check+0xf5>
c0105a6d:	68 43 9b 10 c0       	push   $0xc0109b43
c0105a72:	68 36 98 10 c0       	push   $0xc0109836
c0105a77:	68 1d 01 00 00       	push   $0x11d
c0105a7c:	68 4b 98 10 c0       	push   $0xc010984b
c0105a81:	e8 9f a9 ff ff       	call   c0100425 <__panic>
    assert(!PageProperty(p0));
c0105a86:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105a89:	83 c0 04             	add    $0x4,%eax
c0105a8c:	c7 45 c0 01 00 00 00 	movl   $0x1,-0x40(%ebp)
c0105a93:	89 45 bc             	mov    %eax,-0x44(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0105a96:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0105a99:	8b 55 c0             	mov    -0x40(%ebp),%edx
c0105a9c:	0f a3 10             	bt     %edx,(%eax)
c0105a9f:	19 c0                	sbb    %eax,%eax
c0105aa1:	89 45 b8             	mov    %eax,-0x48(%ebp)
    return oldbit != 0;
c0105aa4:	83 7d b8 00          	cmpl   $0x0,-0x48(%ebp)
c0105aa8:	0f 95 c0             	setne  %al
c0105aab:	0f b6 c0             	movzbl %al,%eax
c0105aae:	85 c0                	test   %eax,%eax
c0105ab0:	74 19                	je     c0105acb <default_check+0x13a>
c0105ab2:	68 4e 9b 10 c0       	push   $0xc0109b4e
c0105ab7:	68 36 98 10 c0       	push   $0xc0109836
c0105abc:	68 1e 01 00 00       	push   $0x11e
c0105ac1:	68 4b 98 10 c0       	push   $0xc010984b
c0105ac6:	e8 5a a9 ff ff       	call   c0100425 <__panic>

    list_entry_t free_list_store = free_list;
c0105acb:	a1 e4 60 12 c0       	mov    0xc01260e4,%eax
c0105ad0:	8b 15 e8 60 12 c0    	mov    0xc01260e8,%edx
c0105ad6:	89 45 80             	mov    %eax,-0x80(%ebp)
c0105ad9:	89 55 84             	mov    %edx,-0x7c(%ebp)
c0105adc:	c7 45 b0 e4 60 12 c0 	movl   $0xc01260e4,-0x50(%ebp)
    elm->prev = elm->next = elm;
c0105ae3:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0105ae6:	8b 55 b0             	mov    -0x50(%ebp),%edx
c0105ae9:	89 50 04             	mov    %edx,0x4(%eax)
c0105aec:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0105aef:	8b 50 04             	mov    0x4(%eax),%edx
c0105af2:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0105af5:	89 10                	mov    %edx,(%eax)
}
c0105af7:	90                   	nop
c0105af8:	c7 45 b4 e4 60 12 c0 	movl   $0xc01260e4,-0x4c(%ebp)
    return list->next == list;
c0105aff:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c0105b02:	8b 40 04             	mov    0x4(%eax),%eax
c0105b05:	39 45 b4             	cmp    %eax,-0x4c(%ebp)
c0105b08:	0f 94 c0             	sete   %al
c0105b0b:	0f b6 c0             	movzbl %al,%eax
    list_init(&free_list);
    assert(list_empty(&free_list));
c0105b0e:	85 c0                	test   %eax,%eax
c0105b10:	75 19                	jne    c0105b2b <default_check+0x19a>
c0105b12:	68 a3 9a 10 c0       	push   $0xc0109aa3
c0105b17:	68 36 98 10 c0       	push   $0xc0109836
c0105b1c:	68 22 01 00 00       	push   $0x122
c0105b21:	68 4b 98 10 c0       	push   $0xc010984b
c0105b26:	e8 fa a8 ff ff       	call   c0100425 <__panic>
    assert(alloc_page() == NULL);
c0105b2b:	83 ec 0c             	sub    $0xc,%esp
c0105b2e:	6a 01                	push   $0x1
c0105b30:	e8 16 07 00 00       	call   c010624b <alloc_pages>
c0105b35:	83 c4 10             	add    $0x10,%esp
c0105b38:	85 c0                	test   %eax,%eax
c0105b3a:	74 19                	je     c0105b55 <default_check+0x1c4>
c0105b3c:	68 ba 9a 10 c0       	push   $0xc0109aba
c0105b41:	68 36 98 10 c0       	push   $0xc0109836
c0105b46:	68 23 01 00 00       	push   $0x123
c0105b4b:	68 4b 98 10 c0       	push   $0xc010984b
c0105b50:	e8 d0 a8 ff ff       	call   c0100425 <__panic>

    unsigned int nr_free_store = nr_free;
c0105b55:	a1 ec 60 12 c0       	mov    0xc01260ec,%eax
c0105b5a:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    nr_free = 0;
c0105b5d:	c7 05 ec 60 12 c0 00 	movl   $0x0,0xc01260ec
c0105b64:	00 00 00 

    free_pages(p0 + 2, 3);
c0105b67:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105b6a:	83 c0 40             	add    $0x40,%eax
c0105b6d:	83 ec 08             	sub    $0x8,%esp
c0105b70:	6a 03                	push   $0x3
c0105b72:	50                   	push   %eax
c0105b73:	e8 43 07 00 00       	call   c01062bb <free_pages>
c0105b78:	83 c4 10             	add    $0x10,%esp
    assert(alloc_pages(4) == NULL);
c0105b7b:	83 ec 0c             	sub    $0xc,%esp
c0105b7e:	6a 04                	push   $0x4
c0105b80:	e8 c6 06 00 00       	call   c010624b <alloc_pages>
c0105b85:	83 c4 10             	add    $0x10,%esp
c0105b88:	85 c0                	test   %eax,%eax
c0105b8a:	74 19                	je     c0105ba5 <default_check+0x214>
c0105b8c:	68 60 9b 10 c0       	push   $0xc0109b60
c0105b91:	68 36 98 10 c0       	push   $0xc0109836
c0105b96:	68 29 01 00 00       	push   $0x129
c0105b9b:	68 4b 98 10 c0       	push   $0xc010984b
c0105ba0:	e8 80 a8 ff ff       	call   c0100425 <__panic>
    assert(PageProperty(p0 + 2) && p0[2].property == 3);
c0105ba5:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105ba8:	83 c0 40             	add    $0x40,%eax
c0105bab:	83 c0 04             	add    $0x4,%eax
c0105bae:	c7 45 ac 01 00 00 00 	movl   $0x1,-0x54(%ebp)
c0105bb5:	89 45 a8             	mov    %eax,-0x58(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0105bb8:	8b 45 a8             	mov    -0x58(%ebp),%eax
c0105bbb:	8b 55 ac             	mov    -0x54(%ebp),%edx
c0105bbe:	0f a3 10             	bt     %edx,(%eax)
c0105bc1:	19 c0                	sbb    %eax,%eax
c0105bc3:	89 45 a4             	mov    %eax,-0x5c(%ebp)
    return oldbit != 0;
c0105bc6:	83 7d a4 00          	cmpl   $0x0,-0x5c(%ebp)
c0105bca:	0f 95 c0             	setne  %al
c0105bcd:	0f b6 c0             	movzbl %al,%eax
c0105bd0:	85 c0                	test   %eax,%eax
c0105bd2:	74 0e                	je     c0105be2 <default_check+0x251>
c0105bd4:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105bd7:	83 c0 40             	add    $0x40,%eax
c0105bda:	8b 40 08             	mov    0x8(%eax),%eax
c0105bdd:	83 f8 03             	cmp    $0x3,%eax
c0105be0:	74 19                	je     c0105bfb <default_check+0x26a>
c0105be2:	68 78 9b 10 c0       	push   $0xc0109b78
c0105be7:	68 36 98 10 c0       	push   $0xc0109836
c0105bec:	68 2a 01 00 00       	push   $0x12a
c0105bf1:	68 4b 98 10 c0       	push   $0xc010984b
c0105bf6:	e8 2a a8 ff ff       	call   c0100425 <__panic>
    assert((p1 = alloc_pages(3)) != NULL);
c0105bfb:	83 ec 0c             	sub    $0xc,%esp
c0105bfe:	6a 03                	push   $0x3
c0105c00:	e8 46 06 00 00       	call   c010624b <alloc_pages>
c0105c05:	83 c4 10             	add    $0x10,%esp
c0105c08:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0105c0b:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c0105c0f:	75 19                	jne    c0105c2a <default_check+0x299>
c0105c11:	68 a4 9b 10 c0       	push   $0xc0109ba4
c0105c16:	68 36 98 10 c0       	push   $0xc0109836
c0105c1b:	68 2b 01 00 00       	push   $0x12b
c0105c20:	68 4b 98 10 c0       	push   $0xc010984b
c0105c25:	e8 fb a7 ff ff       	call   c0100425 <__panic>
    assert(alloc_page() == NULL);
c0105c2a:	83 ec 0c             	sub    $0xc,%esp
c0105c2d:	6a 01                	push   $0x1
c0105c2f:	e8 17 06 00 00       	call   c010624b <alloc_pages>
c0105c34:	83 c4 10             	add    $0x10,%esp
c0105c37:	85 c0                	test   %eax,%eax
c0105c39:	74 19                	je     c0105c54 <default_check+0x2c3>
c0105c3b:	68 ba 9a 10 c0       	push   $0xc0109aba
c0105c40:	68 36 98 10 c0       	push   $0xc0109836
c0105c45:	68 2c 01 00 00       	push   $0x12c
c0105c4a:	68 4b 98 10 c0       	push   $0xc010984b
c0105c4f:	e8 d1 a7 ff ff       	call   c0100425 <__panic>
    assert(p0 + 2 == p1);
c0105c54:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105c57:	83 c0 40             	add    $0x40,%eax
c0105c5a:	39 45 e0             	cmp    %eax,-0x20(%ebp)
c0105c5d:	74 19                	je     c0105c78 <default_check+0x2e7>
c0105c5f:	68 c2 9b 10 c0       	push   $0xc0109bc2
c0105c64:	68 36 98 10 c0       	push   $0xc0109836
c0105c69:	68 2d 01 00 00       	push   $0x12d
c0105c6e:	68 4b 98 10 c0       	push   $0xc010984b
c0105c73:	e8 ad a7 ff ff       	call   c0100425 <__panic>

    p2 = p0 + 1;
c0105c78:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105c7b:	83 c0 20             	add    $0x20,%eax
c0105c7e:	89 45 dc             	mov    %eax,-0x24(%ebp)
    free_page(p0);
c0105c81:	83 ec 08             	sub    $0x8,%esp
c0105c84:	6a 01                	push   $0x1
c0105c86:	ff 75 e8             	pushl  -0x18(%ebp)
c0105c89:	e8 2d 06 00 00       	call   c01062bb <free_pages>
c0105c8e:	83 c4 10             	add    $0x10,%esp
    free_pages(p1, 3);
c0105c91:	83 ec 08             	sub    $0x8,%esp
c0105c94:	6a 03                	push   $0x3
c0105c96:	ff 75 e0             	pushl  -0x20(%ebp)
c0105c99:	e8 1d 06 00 00       	call   c01062bb <free_pages>
c0105c9e:	83 c4 10             	add    $0x10,%esp
    assert(PageProperty(p0) && p0->property == 1);
c0105ca1:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105ca4:	83 c0 04             	add    $0x4,%eax
c0105ca7:	c7 45 a0 01 00 00 00 	movl   $0x1,-0x60(%ebp)
c0105cae:	89 45 9c             	mov    %eax,-0x64(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0105cb1:	8b 45 9c             	mov    -0x64(%ebp),%eax
c0105cb4:	8b 55 a0             	mov    -0x60(%ebp),%edx
c0105cb7:	0f a3 10             	bt     %edx,(%eax)
c0105cba:	19 c0                	sbb    %eax,%eax
c0105cbc:	89 45 98             	mov    %eax,-0x68(%ebp)
    return oldbit != 0;
c0105cbf:	83 7d 98 00          	cmpl   $0x0,-0x68(%ebp)
c0105cc3:	0f 95 c0             	setne  %al
c0105cc6:	0f b6 c0             	movzbl %al,%eax
c0105cc9:	85 c0                	test   %eax,%eax
c0105ccb:	74 0b                	je     c0105cd8 <default_check+0x347>
c0105ccd:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105cd0:	8b 40 08             	mov    0x8(%eax),%eax
c0105cd3:	83 f8 01             	cmp    $0x1,%eax
c0105cd6:	74 19                	je     c0105cf1 <default_check+0x360>
c0105cd8:	68 d0 9b 10 c0       	push   $0xc0109bd0
c0105cdd:	68 36 98 10 c0       	push   $0xc0109836
c0105ce2:	68 32 01 00 00       	push   $0x132
c0105ce7:	68 4b 98 10 c0       	push   $0xc010984b
c0105cec:	e8 34 a7 ff ff       	call   c0100425 <__panic>
    assert(PageProperty(p1) && p1->property == 3);
c0105cf1:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105cf4:	83 c0 04             	add    $0x4,%eax
c0105cf7:	c7 45 94 01 00 00 00 	movl   $0x1,-0x6c(%ebp)
c0105cfe:	89 45 90             	mov    %eax,-0x70(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0105d01:	8b 45 90             	mov    -0x70(%ebp),%eax
c0105d04:	8b 55 94             	mov    -0x6c(%ebp),%edx
c0105d07:	0f a3 10             	bt     %edx,(%eax)
c0105d0a:	19 c0                	sbb    %eax,%eax
c0105d0c:	89 45 8c             	mov    %eax,-0x74(%ebp)
    return oldbit != 0;
c0105d0f:	83 7d 8c 00          	cmpl   $0x0,-0x74(%ebp)
c0105d13:	0f 95 c0             	setne  %al
c0105d16:	0f b6 c0             	movzbl %al,%eax
c0105d19:	85 c0                	test   %eax,%eax
c0105d1b:	74 0b                	je     c0105d28 <default_check+0x397>
c0105d1d:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105d20:	8b 40 08             	mov    0x8(%eax),%eax
c0105d23:	83 f8 03             	cmp    $0x3,%eax
c0105d26:	74 19                	je     c0105d41 <default_check+0x3b0>
c0105d28:	68 f8 9b 10 c0       	push   $0xc0109bf8
c0105d2d:	68 36 98 10 c0       	push   $0xc0109836
c0105d32:	68 33 01 00 00       	push   $0x133
c0105d37:	68 4b 98 10 c0       	push   $0xc010984b
c0105d3c:	e8 e4 a6 ff ff       	call   c0100425 <__panic>

    assert((p0 = alloc_page()) == p2 - 1);
c0105d41:	83 ec 0c             	sub    $0xc,%esp
c0105d44:	6a 01                	push   $0x1
c0105d46:	e8 00 05 00 00       	call   c010624b <alloc_pages>
c0105d4b:	83 c4 10             	add    $0x10,%esp
c0105d4e:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0105d51:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0105d54:	83 e8 20             	sub    $0x20,%eax
c0105d57:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c0105d5a:	74 19                	je     c0105d75 <default_check+0x3e4>
c0105d5c:	68 1e 9c 10 c0       	push   $0xc0109c1e
c0105d61:	68 36 98 10 c0       	push   $0xc0109836
c0105d66:	68 35 01 00 00       	push   $0x135
c0105d6b:	68 4b 98 10 c0       	push   $0xc010984b
c0105d70:	e8 b0 a6 ff ff       	call   c0100425 <__panic>
    free_page(p0);
c0105d75:	83 ec 08             	sub    $0x8,%esp
c0105d78:	6a 01                	push   $0x1
c0105d7a:	ff 75 e8             	pushl  -0x18(%ebp)
c0105d7d:	e8 39 05 00 00       	call   c01062bb <free_pages>
c0105d82:	83 c4 10             	add    $0x10,%esp
    assert((p0 = alloc_pages(2)) == p2 + 1);
c0105d85:	83 ec 0c             	sub    $0xc,%esp
c0105d88:	6a 02                	push   $0x2
c0105d8a:	e8 bc 04 00 00       	call   c010624b <alloc_pages>
c0105d8f:	83 c4 10             	add    $0x10,%esp
c0105d92:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0105d95:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0105d98:	83 c0 20             	add    $0x20,%eax
c0105d9b:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c0105d9e:	74 19                	je     c0105db9 <default_check+0x428>
c0105da0:	68 3c 9c 10 c0       	push   $0xc0109c3c
c0105da5:	68 36 98 10 c0       	push   $0xc0109836
c0105daa:	68 37 01 00 00       	push   $0x137
c0105daf:	68 4b 98 10 c0       	push   $0xc010984b
c0105db4:	e8 6c a6 ff ff       	call   c0100425 <__panic>

    free_pages(p0, 2);
c0105db9:	83 ec 08             	sub    $0x8,%esp
c0105dbc:	6a 02                	push   $0x2
c0105dbe:	ff 75 e8             	pushl  -0x18(%ebp)
c0105dc1:	e8 f5 04 00 00       	call   c01062bb <free_pages>
c0105dc6:	83 c4 10             	add    $0x10,%esp
    free_page(p2);
c0105dc9:	83 ec 08             	sub    $0x8,%esp
c0105dcc:	6a 01                	push   $0x1
c0105dce:	ff 75 dc             	pushl  -0x24(%ebp)
c0105dd1:	e8 e5 04 00 00       	call   c01062bb <free_pages>
c0105dd6:	83 c4 10             	add    $0x10,%esp

    assert((p0 = alloc_pages(5)) != NULL);
c0105dd9:	83 ec 0c             	sub    $0xc,%esp
c0105ddc:	6a 05                	push   $0x5
c0105dde:	e8 68 04 00 00       	call   c010624b <alloc_pages>
c0105de3:	83 c4 10             	add    $0x10,%esp
c0105de6:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0105de9:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0105ded:	75 19                	jne    c0105e08 <default_check+0x477>
c0105def:	68 5c 9c 10 c0       	push   $0xc0109c5c
c0105df4:	68 36 98 10 c0       	push   $0xc0109836
c0105df9:	68 3c 01 00 00       	push   $0x13c
c0105dfe:	68 4b 98 10 c0       	push   $0xc010984b
c0105e03:	e8 1d a6 ff ff       	call   c0100425 <__panic>
    assert(alloc_page() == NULL);
c0105e08:	83 ec 0c             	sub    $0xc,%esp
c0105e0b:	6a 01                	push   $0x1
c0105e0d:	e8 39 04 00 00       	call   c010624b <alloc_pages>
c0105e12:	83 c4 10             	add    $0x10,%esp
c0105e15:	85 c0                	test   %eax,%eax
c0105e17:	74 19                	je     c0105e32 <default_check+0x4a1>
c0105e19:	68 ba 9a 10 c0       	push   $0xc0109aba
c0105e1e:	68 36 98 10 c0       	push   $0xc0109836
c0105e23:	68 3d 01 00 00       	push   $0x13d
c0105e28:	68 4b 98 10 c0       	push   $0xc010984b
c0105e2d:	e8 f3 a5 ff ff       	call   c0100425 <__panic>

    assert(nr_free == 0);
c0105e32:	a1 ec 60 12 c0       	mov    0xc01260ec,%eax
c0105e37:	85 c0                	test   %eax,%eax
c0105e39:	74 19                	je     c0105e54 <default_check+0x4c3>
c0105e3b:	68 0d 9b 10 c0       	push   $0xc0109b0d
c0105e40:	68 36 98 10 c0       	push   $0xc0109836
c0105e45:	68 3f 01 00 00       	push   $0x13f
c0105e4a:	68 4b 98 10 c0       	push   $0xc010984b
c0105e4f:	e8 d1 a5 ff ff       	call   c0100425 <__panic>
    nr_free = nr_free_store;
c0105e54:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105e57:	a3 ec 60 12 c0       	mov    %eax,0xc01260ec

    free_list = free_list_store;
c0105e5c:	8b 45 80             	mov    -0x80(%ebp),%eax
c0105e5f:	8b 55 84             	mov    -0x7c(%ebp),%edx
c0105e62:	a3 e4 60 12 c0       	mov    %eax,0xc01260e4
c0105e67:	89 15 e8 60 12 c0    	mov    %edx,0xc01260e8
    free_pages(p0, 5);
c0105e6d:	83 ec 08             	sub    $0x8,%esp
c0105e70:	6a 05                	push   $0x5
c0105e72:	ff 75 e8             	pushl  -0x18(%ebp)
c0105e75:	e8 41 04 00 00       	call   c01062bb <free_pages>
c0105e7a:	83 c4 10             	add    $0x10,%esp

    le = &free_list;
c0105e7d:	c7 45 ec e4 60 12 c0 	movl   $0xc01260e4,-0x14(%ebp)
    while ((le = list_next(le)) != &free_list) {
c0105e84:	eb 1d                	jmp    c0105ea3 <default_check+0x512>
        struct Page *p = le2page(le, page_link);
c0105e86:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105e89:	83 e8 0c             	sub    $0xc,%eax
c0105e8c:	89 45 d8             	mov    %eax,-0x28(%ebp)
        count --, total -= p->property;
c0105e8f:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
c0105e93:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0105e96:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0105e99:	8b 40 08             	mov    0x8(%eax),%eax
c0105e9c:	29 c2                	sub    %eax,%edx
c0105e9e:	89 d0                	mov    %edx,%eax
c0105ea0:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105ea3:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105ea6:	89 45 88             	mov    %eax,-0x78(%ebp)
    return listelm->next;
c0105ea9:	8b 45 88             	mov    -0x78(%ebp),%eax
c0105eac:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &free_list) {
c0105eaf:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0105eb2:	81 7d ec e4 60 12 c0 	cmpl   $0xc01260e4,-0x14(%ebp)
c0105eb9:	75 cb                	jne    c0105e86 <default_check+0x4f5>
    }
    assert(count == 0);
c0105ebb:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0105ebf:	74 19                	je     c0105eda <default_check+0x549>
c0105ec1:	68 7a 9c 10 c0       	push   $0xc0109c7a
c0105ec6:	68 36 98 10 c0       	push   $0xc0109836
c0105ecb:	68 4a 01 00 00       	push   $0x14a
c0105ed0:	68 4b 98 10 c0       	push   $0xc010984b
c0105ed5:	e8 4b a5 ff ff       	call   c0100425 <__panic>
    assert(total == 0);
c0105eda:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0105ede:	74 19                	je     c0105ef9 <default_check+0x568>
c0105ee0:	68 85 9c 10 c0       	push   $0xc0109c85
c0105ee5:	68 36 98 10 c0       	push   $0xc0109836
c0105eea:	68 4b 01 00 00       	push   $0x14b
c0105eef:	68 4b 98 10 c0       	push   $0xc010984b
c0105ef4:	e8 2c a5 ff ff       	call   c0100425 <__panic>
}
c0105ef9:	90                   	nop
c0105efa:	c9                   	leave  
c0105efb:	c3                   	ret    

c0105efc <page2ppn>:
page2ppn(struct Page *page) {
c0105efc:	55                   	push   %ebp
c0105efd:	89 e5                	mov    %esp,%ebp
    return page - pages;
c0105eff:	a1 f8 60 12 c0       	mov    0xc01260f8,%eax
c0105f04:	8b 55 08             	mov    0x8(%ebp),%edx
c0105f07:	29 c2                	sub    %eax,%edx
c0105f09:	89 d0                	mov    %edx,%eax
c0105f0b:	c1 f8 05             	sar    $0x5,%eax
}
c0105f0e:	5d                   	pop    %ebp
c0105f0f:	c3                   	ret    

c0105f10 <page2pa>:
page2pa(struct Page *page) {
c0105f10:	55                   	push   %ebp
c0105f11:	89 e5                	mov    %esp,%ebp
    return page2ppn(page) << PGSHIFT;
c0105f13:	ff 75 08             	pushl  0x8(%ebp)
c0105f16:	e8 e1 ff ff ff       	call   c0105efc <page2ppn>
c0105f1b:	83 c4 04             	add    $0x4,%esp
c0105f1e:	c1 e0 0c             	shl    $0xc,%eax
}
c0105f21:	c9                   	leave  
c0105f22:	c3                   	ret    

c0105f23 <pa2page>:
pa2page(uintptr_t pa) {
c0105f23:	55                   	push   %ebp
c0105f24:	89 e5                	mov    %esp,%ebp
c0105f26:	83 ec 08             	sub    $0x8,%esp
    if (PPN(pa) >= npage) {
c0105f29:	8b 45 08             	mov    0x8(%ebp),%eax
c0105f2c:	c1 e8 0c             	shr    $0xc,%eax
c0105f2f:	89 c2                	mov    %eax,%edx
c0105f31:	a1 80 5f 12 c0       	mov    0xc0125f80,%eax
c0105f36:	39 c2                	cmp    %eax,%edx
c0105f38:	72 14                	jb     c0105f4e <pa2page+0x2b>
        panic("pa2page called with invalid pa");
c0105f3a:	83 ec 04             	sub    $0x4,%esp
c0105f3d:	68 c0 9c 10 c0       	push   $0xc0109cc0
c0105f42:	6a 5b                	push   $0x5b
c0105f44:	68 df 9c 10 c0       	push   $0xc0109cdf
c0105f49:	e8 d7 a4 ff ff       	call   c0100425 <__panic>
    return &pages[PPN(pa)];
c0105f4e:	a1 f8 60 12 c0       	mov    0xc01260f8,%eax
c0105f53:	8b 55 08             	mov    0x8(%ebp),%edx
c0105f56:	c1 ea 0c             	shr    $0xc,%edx
c0105f59:	c1 e2 05             	shl    $0x5,%edx
c0105f5c:	01 d0                	add    %edx,%eax
}
c0105f5e:	c9                   	leave  
c0105f5f:	c3                   	ret    

c0105f60 <page2kva>:
page2kva(struct Page *page) {
c0105f60:	55                   	push   %ebp
c0105f61:	89 e5                	mov    %esp,%ebp
c0105f63:	83 ec 18             	sub    $0x18,%esp
    return KADDR(page2pa(page));
c0105f66:	ff 75 08             	pushl  0x8(%ebp)
c0105f69:	e8 a2 ff ff ff       	call   c0105f10 <page2pa>
c0105f6e:	83 c4 04             	add    $0x4,%esp
c0105f71:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0105f74:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105f77:	c1 e8 0c             	shr    $0xc,%eax
c0105f7a:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105f7d:	a1 80 5f 12 c0       	mov    0xc0125f80,%eax
c0105f82:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c0105f85:	72 14                	jb     c0105f9b <page2kva+0x3b>
c0105f87:	ff 75 f4             	pushl  -0xc(%ebp)
c0105f8a:	68 f0 9c 10 c0       	push   $0xc0109cf0
c0105f8f:	6a 62                	push   $0x62
c0105f91:	68 df 9c 10 c0       	push   $0xc0109cdf
c0105f96:	e8 8a a4 ff ff       	call   c0100425 <__panic>
c0105f9b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105f9e:	2d 00 00 00 40       	sub    $0x40000000,%eax
}
c0105fa3:	c9                   	leave  
c0105fa4:	c3                   	ret    

c0105fa5 <kva2page>:
kva2page(void *kva) {
c0105fa5:	55                   	push   %ebp
c0105fa6:	89 e5                	mov    %esp,%ebp
c0105fa8:	83 ec 18             	sub    $0x18,%esp
    return pa2page(PADDR(kva));
c0105fab:	8b 45 08             	mov    0x8(%ebp),%eax
c0105fae:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0105fb1:	81 7d f4 ff ff ff bf 	cmpl   $0xbfffffff,-0xc(%ebp)
c0105fb8:	77 14                	ja     c0105fce <kva2page+0x29>
c0105fba:	ff 75 f4             	pushl  -0xc(%ebp)
c0105fbd:	68 14 9d 10 c0       	push   $0xc0109d14
c0105fc2:	6a 67                	push   $0x67
c0105fc4:	68 df 9c 10 c0       	push   $0xc0109cdf
c0105fc9:	e8 57 a4 ff ff       	call   c0100425 <__panic>
c0105fce:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105fd1:	05 00 00 00 40       	add    $0x40000000,%eax
c0105fd6:	83 ec 0c             	sub    $0xc,%esp
c0105fd9:	50                   	push   %eax
c0105fda:	e8 44 ff ff ff       	call   c0105f23 <pa2page>
c0105fdf:	83 c4 10             	add    $0x10,%esp
}
c0105fe2:	c9                   	leave  
c0105fe3:	c3                   	ret    

c0105fe4 <pte2page>:
pte2page(pte_t pte) {
c0105fe4:	55                   	push   %ebp
c0105fe5:	89 e5                	mov    %esp,%ebp
c0105fe7:	83 ec 08             	sub    $0x8,%esp
    if (!(pte & PTE_P)) {
c0105fea:	8b 45 08             	mov    0x8(%ebp),%eax
c0105fed:	83 e0 01             	and    $0x1,%eax
c0105ff0:	85 c0                	test   %eax,%eax
c0105ff2:	75 14                	jne    c0106008 <pte2page+0x24>
        panic("pte2page called with invalid pte");
c0105ff4:	83 ec 04             	sub    $0x4,%esp
c0105ff7:	68 38 9d 10 c0       	push   $0xc0109d38
c0105ffc:	6a 6d                	push   $0x6d
c0105ffe:	68 df 9c 10 c0       	push   $0xc0109cdf
c0106003:	e8 1d a4 ff ff       	call   c0100425 <__panic>
    return pa2page(PTE_ADDR(pte));
c0106008:	8b 45 08             	mov    0x8(%ebp),%eax
c010600b:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0106010:	83 ec 0c             	sub    $0xc,%esp
c0106013:	50                   	push   %eax
c0106014:	e8 0a ff ff ff       	call   c0105f23 <pa2page>
c0106019:	83 c4 10             	add    $0x10,%esp
}
c010601c:	c9                   	leave  
c010601d:	c3                   	ret    

c010601e <pde2page>:
pde2page(pde_t pde) {
c010601e:	55                   	push   %ebp
c010601f:	89 e5                	mov    %esp,%ebp
c0106021:	83 ec 08             	sub    $0x8,%esp
    return pa2page(PDE_ADDR(pde));
c0106024:	8b 45 08             	mov    0x8(%ebp),%eax
c0106027:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c010602c:	83 ec 0c             	sub    $0xc,%esp
c010602f:	50                   	push   %eax
c0106030:	e8 ee fe ff ff       	call   c0105f23 <pa2page>
c0106035:	83 c4 10             	add    $0x10,%esp
}
c0106038:	c9                   	leave  
c0106039:	c3                   	ret    

c010603a <page_ref>:
page_ref(struct Page *page) {
c010603a:	55                   	push   %ebp
c010603b:	89 e5                	mov    %esp,%ebp
    return page->ref;
c010603d:	8b 45 08             	mov    0x8(%ebp),%eax
c0106040:	8b 00                	mov    (%eax),%eax
}
c0106042:	5d                   	pop    %ebp
c0106043:	c3                   	ret    

c0106044 <page_ref_inc>:

static inline int
page_ref_inc(struct Page *page) {
c0106044:	55                   	push   %ebp
c0106045:	89 e5                	mov    %esp,%ebp
    page->ref += 1;
c0106047:	8b 45 08             	mov    0x8(%ebp),%eax
c010604a:	8b 00                	mov    (%eax),%eax
c010604c:	8d 50 01             	lea    0x1(%eax),%edx
c010604f:	8b 45 08             	mov    0x8(%ebp),%eax
c0106052:	89 10                	mov    %edx,(%eax)
    return page->ref;
c0106054:	8b 45 08             	mov    0x8(%ebp),%eax
c0106057:	8b 00                	mov    (%eax),%eax
}
c0106059:	5d                   	pop    %ebp
c010605a:	c3                   	ret    

c010605b <page_ref_dec>:

static inline int
page_ref_dec(struct Page *page) {
c010605b:	55                   	push   %ebp
c010605c:	89 e5                	mov    %esp,%ebp
    page->ref -= 1;
c010605e:	8b 45 08             	mov    0x8(%ebp),%eax
c0106061:	8b 00                	mov    (%eax),%eax
c0106063:	8d 50 ff             	lea    -0x1(%eax),%edx
c0106066:	8b 45 08             	mov    0x8(%ebp),%eax
c0106069:	89 10                	mov    %edx,(%eax)
    return page->ref;
c010606b:	8b 45 08             	mov    0x8(%ebp),%eax
c010606e:	8b 00                	mov    (%eax),%eax
}
c0106070:	5d                   	pop    %ebp
c0106071:	c3                   	ret    

c0106072 <__intr_save>:
__intr_save(void) {
c0106072:	55                   	push   %ebp
c0106073:	89 e5                	mov    %esp,%ebp
c0106075:	83 ec 18             	sub    $0x18,%esp
    asm volatile ("pushfl; popl %0" : "=r" (eflags));
c0106078:	9c                   	pushf  
c0106079:	58                   	pop    %eax
c010607a:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return eflags;
c010607d:	8b 45 f4             	mov    -0xc(%ebp),%eax
    if (read_eflags() & FL_IF) {
c0106080:	25 00 02 00 00       	and    $0x200,%eax
c0106085:	85 c0                	test   %eax,%eax
c0106087:	74 0c                	je     c0106095 <__intr_save+0x23>
        intr_disable();
c0106089:	e8 fd c0 ff ff       	call   c010218b <intr_disable>
        return 1;
c010608e:	b8 01 00 00 00       	mov    $0x1,%eax
c0106093:	eb 05                	jmp    c010609a <__intr_save+0x28>
    return 0;
c0106095:	b8 00 00 00 00       	mov    $0x0,%eax
}
c010609a:	c9                   	leave  
c010609b:	c3                   	ret    

c010609c <__intr_restore>:
__intr_restore(bool flag) {
c010609c:	55                   	push   %ebp
c010609d:	89 e5                	mov    %esp,%ebp
c010609f:	83 ec 08             	sub    $0x8,%esp
    if (flag) {
c01060a2:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c01060a6:	74 05                	je     c01060ad <__intr_restore+0x11>
        intr_enable();
c01060a8:	e8 d2 c0 ff ff       	call   c010217f <intr_enable>
}
c01060ad:	90                   	nop
c01060ae:	c9                   	leave  
c01060af:	c3                   	ret    

c01060b0 <lgdt>:
/* *
 * lgdt - load the global descriptor table register and reset the
 * data/code segement registers for kernel.
 * */
static inline void
lgdt(struct pseudodesc *pd) {
c01060b0:	55                   	push   %ebp
c01060b1:	89 e5                	mov    %esp,%ebp
    asm volatile ("lgdt (%0)" :: "r" (pd));
c01060b3:	8b 45 08             	mov    0x8(%ebp),%eax
c01060b6:	0f 01 10             	lgdtl  (%eax)
    asm volatile ("movw %%ax, %%gs" :: "a" (USER_DS));
c01060b9:	b8 23 00 00 00       	mov    $0x23,%eax
c01060be:	8e e8                	mov    %eax,%gs
    asm volatile ("movw %%ax, %%fs" :: "a" (USER_DS));
c01060c0:	b8 23 00 00 00       	mov    $0x23,%eax
c01060c5:	8e e0                	mov    %eax,%fs
    asm volatile ("movw %%ax, %%es" :: "a" (KERNEL_DS));
c01060c7:	b8 10 00 00 00       	mov    $0x10,%eax
c01060cc:	8e c0                	mov    %eax,%es
    asm volatile ("movw %%ax, %%ds" :: "a" (KERNEL_DS));
c01060ce:	b8 10 00 00 00       	mov    $0x10,%eax
c01060d3:	8e d8                	mov    %eax,%ds
    asm volatile ("movw %%ax, %%ss" :: "a" (KERNEL_DS));
c01060d5:	b8 10 00 00 00       	mov    $0x10,%eax
c01060da:	8e d0                	mov    %eax,%ss
    // reload cs
    asm volatile ("ljmp %0, $1f\n 1:\n" :: "i" (KERNEL_CS));
c01060dc:	ea e3 60 10 c0 08 00 	ljmp   $0x8,$0xc01060e3
}
c01060e3:	90                   	nop
c01060e4:	5d                   	pop    %ebp
c01060e5:	c3                   	ret    

c01060e6 <load_esp0>:
 * load_esp0 - change the ESP0 in default task state segment,
 * so that we can use different kernel stack when we trap frame
 * user to kernel.
 * */
void
load_esp0(uintptr_t esp0) {
c01060e6:	f3 0f 1e fb          	endbr32 
c01060ea:	55                   	push   %ebp
c01060eb:	89 e5                	mov    %esp,%ebp
    ts.ts_esp0 = esp0;
c01060ed:	8b 45 08             	mov    0x8(%ebp),%eax
c01060f0:	a3 a4 5f 12 c0       	mov    %eax,0xc0125fa4
}
c01060f5:	90                   	nop
c01060f6:	5d                   	pop    %ebp
c01060f7:	c3                   	ret    

c01060f8 <gdt_init>:

/* gdt_init - initialize the default GDT and TSS */
static void
gdt_init(void) {
c01060f8:	f3 0f 1e fb          	endbr32 
c01060fc:	55                   	push   %ebp
c01060fd:	89 e5                	mov    %esp,%ebp
c01060ff:	83 ec 10             	sub    $0x10,%esp
    // set boot kernel stack and default SS0
    load_esp0((uintptr_t)bootstacktop);
c0106102:	b8 00 20 12 c0       	mov    $0xc0122000,%eax
c0106107:	50                   	push   %eax
c0106108:	e8 d9 ff ff ff       	call   c01060e6 <load_esp0>
c010610d:	83 c4 04             	add    $0x4,%esp
    ts.ts_ss0 = KERNEL_DS;
c0106110:	66 c7 05 a8 5f 12 c0 	movw   $0x10,0xc0125fa8
c0106117:	10 00 

    // initialize the TSS filed of the gdt
    gdt[SEG_TSS] = SEGTSS(STS_T32A, (uintptr_t)&ts, sizeof(ts), DPL_KERNEL);
c0106119:	66 c7 05 48 2a 12 c0 	movw   $0x68,0xc0122a48
c0106120:	68 00 
c0106122:	b8 a0 5f 12 c0       	mov    $0xc0125fa0,%eax
c0106127:	66 a3 4a 2a 12 c0    	mov    %ax,0xc0122a4a
c010612d:	b8 a0 5f 12 c0       	mov    $0xc0125fa0,%eax
c0106132:	c1 e8 10             	shr    $0x10,%eax
c0106135:	a2 4c 2a 12 c0       	mov    %al,0xc0122a4c
c010613a:	0f b6 05 4d 2a 12 c0 	movzbl 0xc0122a4d,%eax
c0106141:	83 e0 f0             	and    $0xfffffff0,%eax
c0106144:	83 c8 09             	or     $0x9,%eax
c0106147:	a2 4d 2a 12 c0       	mov    %al,0xc0122a4d
c010614c:	0f b6 05 4d 2a 12 c0 	movzbl 0xc0122a4d,%eax
c0106153:	83 e0 ef             	and    $0xffffffef,%eax
c0106156:	a2 4d 2a 12 c0       	mov    %al,0xc0122a4d
c010615b:	0f b6 05 4d 2a 12 c0 	movzbl 0xc0122a4d,%eax
c0106162:	83 e0 9f             	and    $0xffffff9f,%eax
c0106165:	a2 4d 2a 12 c0       	mov    %al,0xc0122a4d
c010616a:	0f b6 05 4d 2a 12 c0 	movzbl 0xc0122a4d,%eax
c0106171:	83 c8 80             	or     $0xffffff80,%eax
c0106174:	a2 4d 2a 12 c0       	mov    %al,0xc0122a4d
c0106179:	0f b6 05 4e 2a 12 c0 	movzbl 0xc0122a4e,%eax
c0106180:	83 e0 f0             	and    $0xfffffff0,%eax
c0106183:	a2 4e 2a 12 c0       	mov    %al,0xc0122a4e
c0106188:	0f b6 05 4e 2a 12 c0 	movzbl 0xc0122a4e,%eax
c010618f:	83 e0 ef             	and    $0xffffffef,%eax
c0106192:	a2 4e 2a 12 c0       	mov    %al,0xc0122a4e
c0106197:	0f b6 05 4e 2a 12 c0 	movzbl 0xc0122a4e,%eax
c010619e:	83 e0 df             	and    $0xffffffdf,%eax
c01061a1:	a2 4e 2a 12 c0       	mov    %al,0xc0122a4e
c01061a6:	0f b6 05 4e 2a 12 c0 	movzbl 0xc0122a4e,%eax
c01061ad:	83 c8 40             	or     $0x40,%eax
c01061b0:	a2 4e 2a 12 c0       	mov    %al,0xc0122a4e
c01061b5:	0f b6 05 4e 2a 12 c0 	movzbl 0xc0122a4e,%eax
c01061bc:	83 e0 7f             	and    $0x7f,%eax
c01061bf:	a2 4e 2a 12 c0       	mov    %al,0xc0122a4e
c01061c4:	b8 a0 5f 12 c0       	mov    $0xc0125fa0,%eax
c01061c9:	c1 e8 18             	shr    $0x18,%eax
c01061cc:	a2 4f 2a 12 c0       	mov    %al,0xc0122a4f

    // reload all segment registers
    lgdt(&gdt_pd);
c01061d1:	68 50 2a 12 c0       	push   $0xc0122a50
c01061d6:	e8 d5 fe ff ff       	call   c01060b0 <lgdt>
c01061db:	83 c4 04             	add    $0x4,%esp
c01061de:	66 c7 45 fe 28 00    	movw   $0x28,-0x2(%ebp)
    asm volatile ("ltr %0" :: "r" (sel) : "memory");
c01061e4:	0f b7 45 fe          	movzwl -0x2(%ebp),%eax
c01061e8:	0f 00 d8             	ltr    %ax
}
c01061eb:	90                   	nop

    // load the TSS
    ltr(GD_TSS);
}
c01061ec:	90                   	nop
c01061ed:	c9                   	leave  
c01061ee:	c3                   	ret    

c01061ef <init_pmm_manager>:

//init_pmm_manager - initialize a pmm_manager instance
static void
init_pmm_manager(void) {
c01061ef:	f3 0f 1e fb          	endbr32 
c01061f3:	55                   	push   %ebp
c01061f4:	89 e5                	mov    %esp,%ebp
c01061f6:	83 ec 08             	sub    $0x8,%esp
    pmm_manager = &default_pmm_manager;
c01061f9:	c7 05 f0 60 12 c0 a4 	movl   $0xc0109ca4,0xc01260f0
c0106200:	9c 10 c0 
    cprintf("memory management: %s\n", pmm_manager->name);
c0106203:	a1 f0 60 12 c0       	mov    0xc01260f0,%eax
c0106208:	8b 00                	mov    (%eax),%eax
c010620a:	83 ec 08             	sub    $0x8,%esp
c010620d:	50                   	push   %eax
c010620e:	68 64 9d 10 c0       	push   $0xc0109d64
c0106213:	e8 92 a0 ff ff       	call   c01002aa <cprintf>
c0106218:	83 c4 10             	add    $0x10,%esp
    pmm_manager->init();
c010621b:	a1 f0 60 12 c0       	mov    0xc01260f0,%eax
c0106220:	8b 40 04             	mov    0x4(%eax),%eax
c0106223:	ff d0                	call   *%eax
}
c0106225:	90                   	nop
c0106226:	c9                   	leave  
c0106227:	c3                   	ret    

c0106228 <init_memmap>:

//init_memmap - call pmm->init_memmap to build Page struct for free memory  
static void
init_memmap(struct Page *base, size_t n) {
c0106228:	f3 0f 1e fb          	endbr32 
c010622c:	55                   	push   %ebp
c010622d:	89 e5                	mov    %esp,%ebp
c010622f:	83 ec 08             	sub    $0x8,%esp
    pmm_manager->init_memmap(base, n);
c0106232:	a1 f0 60 12 c0       	mov    0xc01260f0,%eax
c0106237:	8b 40 08             	mov    0x8(%eax),%eax
c010623a:	83 ec 08             	sub    $0x8,%esp
c010623d:	ff 75 0c             	pushl  0xc(%ebp)
c0106240:	ff 75 08             	pushl  0x8(%ebp)
c0106243:	ff d0                	call   *%eax
c0106245:	83 c4 10             	add    $0x10,%esp
}
c0106248:	90                   	nop
c0106249:	c9                   	leave  
c010624a:	c3                   	ret    

c010624b <alloc_pages>:

//alloc_pages - call pmm->alloc_pages to allocate a continuous n*PAGESIZE memory 
struct Page *
alloc_pages(size_t n) {
c010624b:	f3 0f 1e fb          	endbr32 
c010624f:	55                   	push   %ebp
c0106250:	89 e5                	mov    %esp,%ebp
c0106252:	83 ec 18             	sub    $0x18,%esp
    struct Page *page=NULL;
c0106255:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    bool intr_flag;
    
    while (1)
    {
         local_intr_save(intr_flag);
c010625c:	e8 11 fe ff ff       	call   c0106072 <__intr_save>
c0106261:	89 45 f0             	mov    %eax,-0x10(%ebp)
         {
              page = pmm_manager->alloc_pages(n);
c0106264:	a1 f0 60 12 c0       	mov    0xc01260f0,%eax
c0106269:	8b 40 0c             	mov    0xc(%eax),%eax
c010626c:	83 ec 0c             	sub    $0xc,%esp
c010626f:	ff 75 08             	pushl  0x8(%ebp)
c0106272:	ff d0                	call   *%eax
c0106274:	83 c4 10             	add    $0x10,%esp
c0106277:	89 45 f4             	mov    %eax,-0xc(%ebp)
         }
         local_intr_restore(intr_flag);
c010627a:	83 ec 0c             	sub    $0xc,%esp
c010627d:	ff 75 f0             	pushl  -0x10(%ebp)
c0106280:	e8 17 fe ff ff       	call   c010609c <__intr_restore>
c0106285:	83 c4 10             	add    $0x10,%esp

         if (page != NULL || n > 1 || swap_init_ok == 0) break;
c0106288:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c010628c:	75 28                	jne    c01062b6 <alloc_pages+0x6b>
c010628e:	83 7d 08 01          	cmpl   $0x1,0x8(%ebp)
c0106292:	77 22                	ja     c01062b6 <alloc_pages+0x6b>
c0106294:	a1 68 5f 12 c0       	mov    0xc0125f68,%eax
c0106299:	85 c0                	test   %eax,%eax
c010629b:	74 19                	je     c01062b6 <alloc_pages+0x6b>
         
         extern struct mm_struct *check_mm_struct;
         //cprintf("page %x, call swap_out in alloc_pages %d\n",page, n);
         swap_out(check_mm_struct, n, 0);
c010629d:	8b 55 08             	mov    0x8(%ebp),%edx
c01062a0:	a1 10 60 12 c0       	mov    0xc0126010,%eax
c01062a5:	83 ec 04             	sub    $0x4,%esp
c01062a8:	6a 00                	push   $0x0
c01062aa:	52                   	push   %edx
c01062ab:	50                   	push   %eax
c01062ac:	e8 37 e2 ff ff       	call   c01044e8 <swap_out>
c01062b1:	83 c4 10             	add    $0x10,%esp
    {
c01062b4:	eb a6                	jmp    c010625c <alloc_pages+0x11>
    }
    //cprintf("n %d,get page %x, No %d in alloc_pages\n",n,page,(page-pages));
    return page;
c01062b6:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c01062b9:	c9                   	leave  
c01062ba:	c3                   	ret    

c01062bb <free_pages>:

//free_pages - call pmm->free_pages to free a continuous n*PAGESIZE memory 
void
free_pages(struct Page *base, size_t n) {
c01062bb:	f3 0f 1e fb          	endbr32 
c01062bf:	55                   	push   %ebp
c01062c0:	89 e5                	mov    %esp,%ebp
c01062c2:	83 ec 18             	sub    $0x18,%esp
    bool intr_flag;
    local_intr_save(intr_flag);
c01062c5:	e8 a8 fd ff ff       	call   c0106072 <__intr_save>
c01062ca:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        pmm_manager->free_pages(base, n);
c01062cd:	a1 f0 60 12 c0       	mov    0xc01260f0,%eax
c01062d2:	8b 40 10             	mov    0x10(%eax),%eax
c01062d5:	83 ec 08             	sub    $0x8,%esp
c01062d8:	ff 75 0c             	pushl  0xc(%ebp)
c01062db:	ff 75 08             	pushl  0x8(%ebp)
c01062de:	ff d0                	call   *%eax
c01062e0:	83 c4 10             	add    $0x10,%esp
    }
    local_intr_restore(intr_flag);
c01062e3:	83 ec 0c             	sub    $0xc,%esp
c01062e6:	ff 75 f4             	pushl  -0xc(%ebp)
c01062e9:	e8 ae fd ff ff       	call   c010609c <__intr_restore>
c01062ee:	83 c4 10             	add    $0x10,%esp
}
c01062f1:	90                   	nop
c01062f2:	c9                   	leave  
c01062f3:	c3                   	ret    

c01062f4 <nr_free_pages>:

//nr_free_pages - call pmm->nr_free_pages to get the size (nr*PAGESIZE) 
//of current free memory
size_t
nr_free_pages(void) {
c01062f4:	f3 0f 1e fb          	endbr32 
c01062f8:	55                   	push   %ebp
c01062f9:	89 e5                	mov    %esp,%ebp
c01062fb:	83 ec 18             	sub    $0x18,%esp
    size_t ret;
    bool intr_flag;
    local_intr_save(intr_flag);
c01062fe:	e8 6f fd ff ff       	call   c0106072 <__intr_save>
c0106303:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        ret = pmm_manager->nr_free_pages();
c0106306:	a1 f0 60 12 c0       	mov    0xc01260f0,%eax
c010630b:	8b 40 14             	mov    0x14(%eax),%eax
c010630e:	ff d0                	call   *%eax
c0106310:	89 45 f0             	mov    %eax,-0x10(%ebp)
    }
    local_intr_restore(intr_flag);
c0106313:	83 ec 0c             	sub    $0xc,%esp
c0106316:	ff 75 f4             	pushl  -0xc(%ebp)
c0106319:	e8 7e fd ff ff       	call   c010609c <__intr_restore>
c010631e:	83 c4 10             	add    $0x10,%esp
    return ret;
c0106321:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
c0106324:	c9                   	leave  
c0106325:	c3                   	ret    

c0106326 <page_init>:

/* pmm_init - initialize the physical memory management */
static void
page_init(void) {
c0106326:	f3 0f 1e fb          	endbr32 
c010632a:	55                   	push   %ebp
c010632b:	89 e5                	mov    %esp,%ebp
c010632d:	57                   	push   %edi
c010632e:	56                   	push   %esi
c010632f:	53                   	push   %ebx
c0106330:	83 ec 7c             	sub    $0x7c,%esp
    struct e820map *memmap = (struct e820map *)(0x8000 + KERNBASE);
c0106333:	c7 45 c4 00 80 00 c0 	movl   $0xc0008000,-0x3c(%ebp)
    uint64_t maxpa = 0;
c010633a:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
c0106341:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)

    cprintf("e820map:\n");
c0106348:	83 ec 0c             	sub    $0xc,%esp
c010634b:	68 7b 9d 10 c0       	push   $0xc0109d7b
c0106350:	e8 55 9f ff ff       	call   c01002aa <cprintf>
c0106355:	83 c4 10             	add    $0x10,%esp
    int i;
    for (i = 0; i < memmap->nr_map; i ++) {
c0106358:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c010635f:	e9 f4 00 00 00       	jmp    c0106458 <page_init+0x132>
        uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size;
c0106364:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0106367:	8b 55 dc             	mov    -0x24(%ebp),%edx
c010636a:	89 d0                	mov    %edx,%eax
c010636c:	c1 e0 02             	shl    $0x2,%eax
c010636f:	01 d0                	add    %edx,%eax
c0106371:	c1 e0 02             	shl    $0x2,%eax
c0106374:	01 c8                	add    %ecx,%eax
c0106376:	8b 50 08             	mov    0x8(%eax),%edx
c0106379:	8b 40 04             	mov    0x4(%eax),%eax
c010637c:	89 45 a0             	mov    %eax,-0x60(%ebp)
c010637f:	89 55 a4             	mov    %edx,-0x5c(%ebp)
c0106382:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0106385:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0106388:	89 d0                	mov    %edx,%eax
c010638a:	c1 e0 02             	shl    $0x2,%eax
c010638d:	01 d0                	add    %edx,%eax
c010638f:	c1 e0 02             	shl    $0x2,%eax
c0106392:	01 c8                	add    %ecx,%eax
c0106394:	8b 48 0c             	mov    0xc(%eax),%ecx
c0106397:	8b 58 10             	mov    0x10(%eax),%ebx
c010639a:	8b 45 a0             	mov    -0x60(%ebp),%eax
c010639d:	8b 55 a4             	mov    -0x5c(%ebp),%edx
c01063a0:	01 c8                	add    %ecx,%eax
c01063a2:	11 da                	adc    %ebx,%edx
c01063a4:	89 45 98             	mov    %eax,-0x68(%ebp)
c01063a7:	89 55 9c             	mov    %edx,-0x64(%ebp)
        cprintf("  memory: %08llx, [%08llx, %08llx], type = %d.\n",
c01063aa:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c01063ad:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01063b0:	89 d0                	mov    %edx,%eax
c01063b2:	c1 e0 02             	shl    $0x2,%eax
c01063b5:	01 d0                	add    %edx,%eax
c01063b7:	c1 e0 02             	shl    $0x2,%eax
c01063ba:	01 c8                	add    %ecx,%eax
c01063bc:	83 c0 14             	add    $0x14,%eax
c01063bf:	8b 00                	mov    (%eax),%eax
c01063c1:	89 45 84             	mov    %eax,-0x7c(%ebp)
c01063c4:	8b 45 98             	mov    -0x68(%ebp),%eax
c01063c7:	8b 55 9c             	mov    -0x64(%ebp),%edx
c01063ca:	83 c0 ff             	add    $0xffffffff,%eax
c01063cd:	83 d2 ff             	adc    $0xffffffff,%edx
c01063d0:	89 c1                	mov    %eax,%ecx
c01063d2:	89 d3                	mov    %edx,%ebx
c01063d4:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c01063d7:	89 55 80             	mov    %edx,-0x80(%ebp)
c01063da:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01063dd:	89 d0                	mov    %edx,%eax
c01063df:	c1 e0 02             	shl    $0x2,%eax
c01063e2:	01 d0                	add    %edx,%eax
c01063e4:	c1 e0 02             	shl    $0x2,%eax
c01063e7:	03 45 80             	add    -0x80(%ebp),%eax
c01063ea:	8b 50 10             	mov    0x10(%eax),%edx
c01063ed:	8b 40 0c             	mov    0xc(%eax),%eax
c01063f0:	ff 75 84             	pushl  -0x7c(%ebp)
c01063f3:	53                   	push   %ebx
c01063f4:	51                   	push   %ecx
c01063f5:	ff 75 a4             	pushl  -0x5c(%ebp)
c01063f8:	ff 75 a0             	pushl  -0x60(%ebp)
c01063fb:	52                   	push   %edx
c01063fc:	50                   	push   %eax
c01063fd:	68 88 9d 10 c0       	push   $0xc0109d88
c0106402:	e8 a3 9e ff ff       	call   c01002aa <cprintf>
c0106407:	83 c4 20             	add    $0x20,%esp
                memmap->map[i].size, begin, end - 1, memmap->map[i].type);
        if (memmap->map[i].type == E820_ARM) {
c010640a:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c010640d:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0106410:	89 d0                	mov    %edx,%eax
c0106412:	c1 e0 02             	shl    $0x2,%eax
c0106415:	01 d0                	add    %edx,%eax
c0106417:	c1 e0 02             	shl    $0x2,%eax
c010641a:	01 c8                	add    %ecx,%eax
c010641c:	83 c0 14             	add    $0x14,%eax
c010641f:	8b 00                	mov    (%eax),%eax
c0106421:	83 f8 01             	cmp    $0x1,%eax
c0106424:	75 2e                	jne    c0106454 <page_init+0x12e>
            if (maxpa < end && begin < KMEMSIZE) {
c0106426:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0106429:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c010642c:	3b 45 98             	cmp    -0x68(%ebp),%eax
c010642f:	89 d0                	mov    %edx,%eax
c0106431:	1b 45 9c             	sbb    -0x64(%ebp),%eax
c0106434:	73 1e                	jae    c0106454 <page_init+0x12e>
c0106436:	ba ff ff ff 37       	mov    $0x37ffffff,%edx
c010643b:	b8 00 00 00 00       	mov    $0x0,%eax
c0106440:	3b 55 a0             	cmp    -0x60(%ebp),%edx
c0106443:	1b 45 a4             	sbb    -0x5c(%ebp),%eax
c0106446:	72 0c                	jb     c0106454 <page_init+0x12e>
                maxpa = end;
c0106448:	8b 45 98             	mov    -0x68(%ebp),%eax
c010644b:	8b 55 9c             	mov    -0x64(%ebp),%edx
c010644e:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0106451:	89 55 e4             	mov    %edx,-0x1c(%ebp)
    for (i = 0; i < memmap->nr_map; i ++) {
c0106454:	83 45 dc 01          	addl   $0x1,-0x24(%ebp)
c0106458:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c010645b:	8b 00                	mov    (%eax),%eax
c010645d:	39 45 dc             	cmp    %eax,-0x24(%ebp)
c0106460:	0f 8c fe fe ff ff    	jl     c0106364 <page_init+0x3e>
            }
        }
    }
    if (maxpa > KMEMSIZE) {
c0106466:	ba 00 00 00 38       	mov    $0x38000000,%edx
c010646b:	b8 00 00 00 00       	mov    $0x0,%eax
c0106470:	3b 55 e0             	cmp    -0x20(%ebp),%edx
c0106473:	1b 45 e4             	sbb    -0x1c(%ebp),%eax
c0106476:	73 0e                	jae    c0106486 <page_init+0x160>
        maxpa = KMEMSIZE;
c0106478:	c7 45 e0 00 00 00 38 	movl   $0x38000000,-0x20(%ebp)
c010647f:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
    }

    extern char end[];

    npage = maxpa / PGSIZE;
c0106486:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0106489:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c010648c:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
c0106490:	c1 ea 0c             	shr    $0xc,%edx
c0106493:	a3 80 5f 12 c0       	mov    %eax,0xc0125f80
    pages = (struct Page *)ROUNDUP((void *)end, PGSIZE);
c0106498:	c7 45 c0 00 10 00 00 	movl   $0x1000,-0x40(%ebp)
c010649f:	b8 fc 60 12 c0       	mov    $0xc01260fc,%eax
c01064a4:	8d 50 ff             	lea    -0x1(%eax),%edx
c01064a7:	8b 45 c0             	mov    -0x40(%ebp),%eax
c01064aa:	01 d0                	add    %edx,%eax
c01064ac:	89 45 bc             	mov    %eax,-0x44(%ebp)
c01064af:	8b 45 bc             	mov    -0x44(%ebp),%eax
c01064b2:	ba 00 00 00 00       	mov    $0x0,%edx
c01064b7:	f7 75 c0             	divl   -0x40(%ebp)
c01064ba:	8b 45 bc             	mov    -0x44(%ebp),%eax
c01064bd:	29 d0                	sub    %edx,%eax
c01064bf:	a3 f8 60 12 c0       	mov    %eax,0xc01260f8

    for (i = 0; i < npage; i ++) {
c01064c4:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c01064cb:	eb 28                	jmp    c01064f5 <page_init+0x1cf>
        SetPageReserved(pages + i);
c01064cd:	a1 f8 60 12 c0       	mov    0xc01260f8,%eax
c01064d2:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01064d5:	c1 e2 05             	shl    $0x5,%edx
c01064d8:	01 d0                	add    %edx,%eax
c01064da:	83 c0 04             	add    $0x4,%eax
c01064dd:	c7 45 94 00 00 00 00 	movl   $0x0,-0x6c(%ebp)
c01064e4:	89 45 90             	mov    %eax,-0x70(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c01064e7:	8b 45 90             	mov    -0x70(%ebp),%eax
c01064ea:	8b 55 94             	mov    -0x6c(%ebp),%edx
c01064ed:	0f ab 10             	bts    %edx,(%eax)
}
c01064f0:	90                   	nop
    for (i = 0; i < npage; i ++) {
c01064f1:	83 45 dc 01          	addl   $0x1,-0x24(%ebp)
c01064f5:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01064f8:	a1 80 5f 12 c0       	mov    0xc0125f80,%eax
c01064fd:	39 c2                	cmp    %eax,%edx
c01064ff:	72 cc                	jb     c01064cd <page_init+0x1a7>
    }

    uintptr_t freemem = PADDR((uintptr_t)pages + sizeof(struct Page) * npage);
c0106501:	a1 80 5f 12 c0       	mov    0xc0125f80,%eax
c0106506:	c1 e0 05             	shl    $0x5,%eax
c0106509:	89 c2                	mov    %eax,%edx
c010650b:	a1 f8 60 12 c0       	mov    0xc01260f8,%eax
c0106510:	01 d0                	add    %edx,%eax
c0106512:	89 45 b8             	mov    %eax,-0x48(%ebp)
c0106515:	81 7d b8 ff ff ff bf 	cmpl   $0xbfffffff,-0x48(%ebp)
c010651c:	77 17                	ja     c0106535 <page_init+0x20f>
c010651e:	ff 75 b8             	pushl  -0x48(%ebp)
c0106521:	68 14 9d 10 c0       	push   $0xc0109d14
c0106526:	68 e9 00 00 00       	push   $0xe9
c010652b:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106530:	e8 f0 9e ff ff       	call   c0100425 <__panic>
c0106535:	8b 45 b8             	mov    -0x48(%ebp),%eax
c0106538:	05 00 00 00 40       	add    $0x40000000,%eax
c010653d:	89 45 b4             	mov    %eax,-0x4c(%ebp)

    for (i = 0; i < memmap->nr_map; i ++) {
c0106540:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c0106547:	e9 53 01 00 00       	jmp    c010669f <page_init+0x379>
        uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size;
c010654c:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c010654f:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0106552:	89 d0                	mov    %edx,%eax
c0106554:	c1 e0 02             	shl    $0x2,%eax
c0106557:	01 d0                	add    %edx,%eax
c0106559:	c1 e0 02             	shl    $0x2,%eax
c010655c:	01 c8                	add    %ecx,%eax
c010655e:	8b 50 08             	mov    0x8(%eax),%edx
c0106561:	8b 40 04             	mov    0x4(%eax),%eax
c0106564:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0106567:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c010656a:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c010656d:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0106570:	89 d0                	mov    %edx,%eax
c0106572:	c1 e0 02             	shl    $0x2,%eax
c0106575:	01 d0                	add    %edx,%eax
c0106577:	c1 e0 02             	shl    $0x2,%eax
c010657a:	01 c8                	add    %ecx,%eax
c010657c:	8b 48 0c             	mov    0xc(%eax),%ecx
c010657f:	8b 58 10             	mov    0x10(%eax),%ebx
c0106582:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0106585:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0106588:	01 c8                	add    %ecx,%eax
c010658a:	11 da                	adc    %ebx,%edx
c010658c:	89 45 c8             	mov    %eax,-0x38(%ebp)
c010658f:	89 55 cc             	mov    %edx,-0x34(%ebp)
        if (memmap->map[i].type == E820_ARM) {
c0106592:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0106595:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0106598:	89 d0                	mov    %edx,%eax
c010659a:	c1 e0 02             	shl    $0x2,%eax
c010659d:	01 d0                	add    %edx,%eax
c010659f:	c1 e0 02             	shl    $0x2,%eax
c01065a2:	01 c8                	add    %ecx,%eax
c01065a4:	83 c0 14             	add    $0x14,%eax
c01065a7:	8b 00                	mov    (%eax),%eax
c01065a9:	83 f8 01             	cmp    $0x1,%eax
c01065ac:	0f 85 e9 00 00 00    	jne    c010669b <page_init+0x375>
            if (begin < freemem) {
c01065b2:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c01065b5:	ba 00 00 00 00       	mov    $0x0,%edx
c01065ba:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
c01065bd:	39 45 d0             	cmp    %eax,-0x30(%ebp)
c01065c0:	19 d1                	sbb    %edx,%ecx
c01065c2:	73 0d                	jae    c01065d1 <page_init+0x2ab>
                begin = freemem;
c01065c4:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c01065c7:	89 45 d0             	mov    %eax,-0x30(%ebp)
c01065ca:	c7 45 d4 00 00 00 00 	movl   $0x0,-0x2c(%ebp)
            }
            if (end > KMEMSIZE) {
c01065d1:	ba 00 00 00 38       	mov    $0x38000000,%edx
c01065d6:	b8 00 00 00 00       	mov    $0x0,%eax
c01065db:	3b 55 c8             	cmp    -0x38(%ebp),%edx
c01065de:	1b 45 cc             	sbb    -0x34(%ebp),%eax
c01065e1:	73 0e                	jae    c01065f1 <page_init+0x2cb>
                end = KMEMSIZE;
c01065e3:	c7 45 c8 00 00 00 38 	movl   $0x38000000,-0x38(%ebp)
c01065ea:	c7 45 cc 00 00 00 00 	movl   $0x0,-0x34(%ebp)
            }
            if (begin < end) {
c01065f1:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01065f4:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01065f7:	3b 45 c8             	cmp    -0x38(%ebp),%eax
c01065fa:	89 d0                	mov    %edx,%eax
c01065fc:	1b 45 cc             	sbb    -0x34(%ebp),%eax
c01065ff:	0f 83 96 00 00 00    	jae    c010669b <page_init+0x375>
                begin = ROUNDUP(begin, PGSIZE);
c0106605:	c7 45 b0 00 10 00 00 	movl   $0x1000,-0x50(%ebp)
c010660c:	8b 55 d0             	mov    -0x30(%ebp),%edx
c010660f:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0106612:	01 d0                	add    %edx,%eax
c0106614:	83 e8 01             	sub    $0x1,%eax
c0106617:	89 45 ac             	mov    %eax,-0x54(%ebp)
c010661a:	8b 45 ac             	mov    -0x54(%ebp),%eax
c010661d:	ba 00 00 00 00       	mov    $0x0,%edx
c0106622:	f7 75 b0             	divl   -0x50(%ebp)
c0106625:	8b 45 ac             	mov    -0x54(%ebp),%eax
c0106628:	29 d0                	sub    %edx,%eax
c010662a:	ba 00 00 00 00       	mov    $0x0,%edx
c010662f:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0106632:	89 55 d4             	mov    %edx,-0x2c(%ebp)
                end = ROUNDDOWN(end, PGSIZE);
c0106635:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0106638:	89 45 a8             	mov    %eax,-0x58(%ebp)
c010663b:	8b 45 a8             	mov    -0x58(%ebp),%eax
c010663e:	ba 00 00 00 00       	mov    $0x0,%edx
c0106643:	89 c3                	mov    %eax,%ebx
c0106645:	81 e3 00 f0 ff ff    	and    $0xfffff000,%ebx
c010664b:	89 de                	mov    %ebx,%esi
c010664d:	89 d0                	mov    %edx,%eax
c010664f:	83 e0 00             	and    $0x0,%eax
c0106652:	89 c7                	mov    %eax,%edi
c0106654:	89 75 c8             	mov    %esi,-0x38(%ebp)
c0106657:	89 7d cc             	mov    %edi,-0x34(%ebp)
                if (begin < end) {
c010665a:	8b 45 d0             	mov    -0x30(%ebp),%eax
c010665d:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0106660:	3b 45 c8             	cmp    -0x38(%ebp),%eax
c0106663:	89 d0                	mov    %edx,%eax
c0106665:	1b 45 cc             	sbb    -0x34(%ebp),%eax
c0106668:	73 31                	jae    c010669b <page_init+0x375>
                    init_memmap(pa2page(begin), (end - begin) / PGSIZE);
c010666a:	8b 45 c8             	mov    -0x38(%ebp),%eax
c010666d:	8b 55 cc             	mov    -0x34(%ebp),%edx
c0106670:	2b 45 d0             	sub    -0x30(%ebp),%eax
c0106673:	1b 55 d4             	sbb    -0x2c(%ebp),%edx
c0106676:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
c010667a:	c1 ea 0c             	shr    $0xc,%edx
c010667d:	89 c3                	mov    %eax,%ebx
c010667f:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0106682:	83 ec 0c             	sub    $0xc,%esp
c0106685:	50                   	push   %eax
c0106686:	e8 98 f8 ff ff       	call   c0105f23 <pa2page>
c010668b:	83 c4 10             	add    $0x10,%esp
c010668e:	83 ec 08             	sub    $0x8,%esp
c0106691:	53                   	push   %ebx
c0106692:	50                   	push   %eax
c0106693:	e8 90 fb ff ff       	call   c0106228 <init_memmap>
c0106698:	83 c4 10             	add    $0x10,%esp
    for (i = 0; i < memmap->nr_map; i ++) {
c010669b:	83 45 dc 01          	addl   $0x1,-0x24(%ebp)
c010669f:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c01066a2:	8b 00                	mov    (%eax),%eax
c01066a4:	39 45 dc             	cmp    %eax,-0x24(%ebp)
c01066a7:	0f 8c 9f fe ff ff    	jl     c010654c <page_init+0x226>
                }
            }
        }
    }
}
c01066ad:	90                   	nop
c01066ae:	90                   	nop
c01066af:	8d 65 f4             	lea    -0xc(%ebp),%esp
c01066b2:	5b                   	pop    %ebx
c01066b3:	5e                   	pop    %esi
c01066b4:	5f                   	pop    %edi
c01066b5:	5d                   	pop    %ebp
c01066b6:	c3                   	ret    

c01066b7 <boot_map_segment>:
//  la:   linear address of this memory need to map (after x86 segment map)
//  size: memory size
//  pa:   physical address of this memory
//  perm: permission of this memory  
static void
boot_map_segment(pde_t *pgdir, uintptr_t la, size_t size, uintptr_t pa, uint32_t perm) {
c01066b7:	f3 0f 1e fb          	endbr32 
c01066bb:	55                   	push   %ebp
c01066bc:	89 e5                	mov    %esp,%ebp
c01066be:	83 ec 28             	sub    $0x28,%esp
    assert(PGOFF(la) == PGOFF(pa));
c01066c1:	8b 45 0c             	mov    0xc(%ebp),%eax
c01066c4:	33 45 14             	xor    0x14(%ebp),%eax
c01066c7:	25 ff 0f 00 00       	and    $0xfff,%eax
c01066cc:	85 c0                	test   %eax,%eax
c01066ce:	74 19                	je     c01066e9 <boot_map_segment+0x32>
c01066d0:	68 c6 9d 10 c0       	push   $0xc0109dc6
c01066d5:	68 dd 9d 10 c0       	push   $0xc0109ddd
c01066da:	68 07 01 00 00       	push   $0x107
c01066df:	68 b8 9d 10 c0       	push   $0xc0109db8
c01066e4:	e8 3c 9d ff ff       	call   c0100425 <__panic>
    size_t n = ROUNDUP(size + PGOFF(la), PGSIZE) / PGSIZE;
c01066e9:	c7 45 f0 00 10 00 00 	movl   $0x1000,-0x10(%ebp)
c01066f0:	8b 45 0c             	mov    0xc(%ebp),%eax
c01066f3:	25 ff 0f 00 00       	and    $0xfff,%eax
c01066f8:	89 c2                	mov    %eax,%edx
c01066fa:	8b 45 10             	mov    0x10(%ebp),%eax
c01066fd:	01 c2                	add    %eax,%edx
c01066ff:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0106702:	01 d0                	add    %edx,%eax
c0106704:	83 e8 01             	sub    $0x1,%eax
c0106707:	89 45 ec             	mov    %eax,-0x14(%ebp)
c010670a:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010670d:	ba 00 00 00 00       	mov    $0x0,%edx
c0106712:	f7 75 f0             	divl   -0x10(%ebp)
c0106715:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0106718:	29 d0                	sub    %edx,%eax
c010671a:	c1 e8 0c             	shr    $0xc,%eax
c010671d:	89 45 f4             	mov    %eax,-0xc(%ebp)
    la = ROUNDDOWN(la, PGSIZE);
c0106720:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106723:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0106726:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0106729:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c010672e:	89 45 0c             	mov    %eax,0xc(%ebp)
    pa = ROUNDDOWN(pa, PGSIZE);
c0106731:	8b 45 14             	mov    0x14(%ebp),%eax
c0106734:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0106737:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010673a:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c010673f:	89 45 14             	mov    %eax,0x14(%ebp)
    for (; n > 0; n --, la += PGSIZE, pa += PGSIZE) {
c0106742:	eb 57                	jmp    c010679b <boot_map_segment+0xe4>
        pte_t *ptep = get_pte(pgdir, la, 1);
c0106744:	83 ec 04             	sub    $0x4,%esp
c0106747:	6a 01                	push   $0x1
c0106749:	ff 75 0c             	pushl  0xc(%ebp)
c010674c:	ff 75 08             	pushl  0x8(%ebp)
c010674f:	e8 5c 01 00 00       	call   c01068b0 <get_pte>
c0106754:	83 c4 10             	add    $0x10,%esp
c0106757:	89 45 e0             	mov    %eax,-0x20(%ebp)
        assert(ptep != NULL);
c010675a:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c010675e:	75 19                	jne    c0106779 <boot_map_segment+0xc2>
c0106760:	68 f2 9d 10 c0       	push   $0xc0109df2
c0106765:	68 dd 9d 10 c0       	push   $0xc0109ddd
c010676a:	68 0d 01 00 00       	push   $0x10d
c010676f:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106774:	e8 ac 9c ff ff       	call   c0100425 <__panic>
        *ptep = pa | PTE_P | perm;
c0106779:	8b 45 14             	mov    0x14(%ebp),%eax
c010677c:	0b 45 18             	or     0x18(%ebp),%eax
c010677f:	83 c8 01             	or     $0x1,%eax
c0106782:	89 c2                	mov    %eax,%edx
c0106784:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0106787:	89 10                	mov    %edx,(%eax)
    for (; n > 0; n --, la += PGSIZE, pa += PGSIZE) {
c0106789:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
c010678d:	81 45 0c 00 10 00 00 	addl   $0x1000,0xc(%ebp)
c0106794:	81 45 14 00 10 00 00 	addl   $0x1000,0x14(%ebp)
c010679b:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c010679f:	75 a3                	jne    c0106744 <boot_map_segment+0x8d>
    }
}
c01067a1:	90                   	nop
c01067a2:	90                   	nop
c01067a3:	c9                   	leave  
c01067a4:	c3                   	ret    

c01067a5 <boot_alloc_page>:

//boot_alloc_page - allocate one page using pmm->alloc_pages(1) 
// return value: the kernel virtual address of this allocated page
//note: this function is used to get the memory for PDT(Page Directory Table)&PT(Page Table)
static void *
boot_alloc_page(void) {
c01067a5:	f3 0f 1e fb          	endbr32 
c01067a9:	55                   	push   %ebp
c01067aa:	89 e5                	mov    %esp,%ebp
c01067ac:	83 ec 18             	sub    $0x18,%esp
    struct Page *p = alloc_page();
c01067af:	83 ec 0c             	sub    $0xc,%esp
c01067b2:	6a 01                	push   $0x1
c01067b4:	e8 92 fa ff ff       	call   c010624b <alloc_pages>
c01067b9:	83 c4 10             	add    $0x10,%esp
c01067bc:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (p == NULL) {
c01067bf:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01067c3:	75 17                	jne    c01067dc <boot_alloc_page+0x37>
        panic("boot_alloc_page failed.\n");
c01067c5:	83 ec 04             	sub    $0x4,%esp
c01067c8:	68 ff 9d 10 c0       	push   $0xc0109dff
c01067cd:	68 19 01 00 00       	push   $0x119
c01067d2:	68 b8 9d 10 c0       	push   $0xc0109db8
c01067d7:	e8 49 9c ff ff       	call   c0100425 <__panic>
    }
    return page2kva(p);
c01067dc:	83 ec 0c             	sub    $0xc,%esp
c01067df:	ff 75 f4             	pushl  -0xc(%ebp)
c01067e2:	e8 79 f7 ff ff       	call   c0105f60 <page2kva>
c01067e7:	83 c4 10             	add    $0x10,%esp
}
c01067ea:	c9                   	leave  
c01067eb:	c3                   	ret    

c01067ec <pmm_init>:

//pmm_init - setup a pmm to manage physical memory, build PDT&PT to setup paging mechanism 
//         - check the correctness of pmm & paging mechanism, print PDT&PT
void
pmm_init(void) {
c01067ec:	f3 0f 1e fb          	endbr32 
c01067f0:	55                   	push   %ebp
c01067f1:	89 e5                	mov    %esp,%ebp
c01067f3:	83 ec 18             	sub    $0x18,%esp
    // We've already enabled paging
    boot_cr3 = PADDR(boot_pgdir);
c01067f6:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c01067fb:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01067fe:	81 7d f4 ff ff ff bf 	cmpl   $0xbfffffff,-0xc(%ebp)
c0106805:	77 17                	ja     c010681e <pmm_init+0x32>
c0106807:	ff 75 f4             	pushl  -0xc(%ebp)
c010680a:	68 14 9d 10 c0       	push   $0xc0109d14
c010680f:	68 23 01 00 00       	push   $0x123
c0106814:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106819:	e8 07 9c ff ff       	call   c0100425 <__panic>
c010681e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106821:	05 00 00 00 40       	add    $0x40000000,%eax
c0106826:	a3 f4 60 12 c0       	mov    %eax,0xc01260f4
    //We need to alloc/free the physical memory (granularity is 4KB or other size). 
    //So a framework of physical memory manager (struct pmm_manager)is defined in pmm.h
    //First we should init a physical memory manager(pmm) based on the framework.
    //Then pmm can alloc/free the physical memory. 
    //Now the first_fit/best_fit/worst_fit/buddy_system pmm are available.
    init_pmm_manager();
c010682b:	e8 bf f9 ff ff       	call   c01061ef <init_pmm_manager>

    // detect physical memory space, reserve already used memory,
    // then use pmm->init_memmap to create free page list
    page_init();
c0106830:	e8 f1 fa ff ff       	call   c0106326 <page_init>

    //use pmm->check to verify the correctness of the alloc/free function in a pmm
    check_alloc_page();
c0106835:	e8 cc 02 00 00       	call   c0106b06 <check_alloc_page>

    check_pgdir();
c010683a:	e8 ee 02 00 00       	call   c0106b2d <check_pgdir>

    static_assert(KERNBASE % PTSIZE == 0 && KERNTOP % PTSIZE == 0);

    // recursively insert boot_pgdir in itself
    // to form a virtual page table at virtual address VPT
    boot_pgdir[PDX(VPT)] = PADDR(boot_pgdir) | PTE_P | PTE_W;
c010683f:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0106844:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0106847:	81 7d f0 ff ff ff bf 	cmpl   $0xbfffffff,-0x10(%ebp)
c010684e:	77 17                	ja     c0106867 <pmm_init+0x7b>
c0106850:	ff 75 f0             	pushl  -0x10(%ebp)
c0106853:	68 14 9d 10 c0       	push   $0xc0109d14
c0106858:	68 39 01 00 00       	push   $0x139
c010685d:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106862:	e8 be 9b ff ff       	call   c0100425 <__panic>
c0106867:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010686a:	8d 90 00 00 00 40    	lea    0x40000000(%eax),%edx
c0106870:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0106875:	05 ac 0f 00 00       	add    $0xfac,%eax
c010687a:	83 ca 03             	or     $0x3,%edx
c010687d:	89 10                	mov    %edx,(%eax)

    // map all physical memory to linear memory with base linear addr KERNBASE
    // linear_addr KERNBASE ~ KERNBASE + KMEMSIZE = phy_addr 0 ~ KMEMSIZE
    boot_map_segment(boot_pgdir, KERNBASE, KMEMSIZE, 0, PTE_W);
c010687f:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0106884:	83 ec 0c             	sub    $0xc,%esp
c0106887:	6a 02                	push   $0x2
c0106889:	6a 00                	push   $0x0
c010688b:	68 00 00 00 38       	push   $0x38000000
c0106890:	68 00 00 00 c0       	push   $0xc0000000
c0106895:	50                   	push   %eax
c0106896:	e8 1c fe ff ff       	call   c01066b7 <boot_map_segment>
c010689b:	83 c4 20             	add    $0x20,%esp

    // Since we are using bootloader's GDT,
    // we should reload gdt (second time, the last time) to get user segments and the TSS
    // map virtual_addr 0 ~ 4G = linear_addr 0 ~ 4G
    // then set kernel stack (ss:esp) in TSS, setup TSS in gdt, load TSS
    gdt_init();
c010689e:	e8 55 f8 ff ff       	call   c01060f8 <gdt_init>

    //now the basic virtual memory map(see memalyout.h) is established.
    //check the correctness of the basic virtual memory map.
    check_boot_pgdir();
c01068a3:	e8 ef 07 00 00       	call   c0107097 <check_boot_pgdir>

    print_pgdir();
c01068a8:	e8 f1 0b 00 00       	call   c010749e <print_pgdir>

}
c01068ad:	90                   	nop
c01068ae:	c9                   	leave  
c01068af:	c3                   	ret    

c01068b0 <get_pte>:
// return vaule: the kernel virtual address of this pte
// 注意返回的是PTE的指针，而不是PTE
// 注意指针类型
// 注意区分地址的属性，虚地址or物理地址
pte_t *
get_pte(pde_t *pgdir, uintptr_t la, bool create) {
c01068b0:	f3 0f 1e fb          	endbr32 
c01068b4:	55                   	push   %ebp
c01068b5:	89 e5                	mov    %esp,%ebp
                          // (6) clear page content using memset
                          // (7) set page directory entry's permission
    }
    return NULL;          // (8) return page table entry
#endif
}
c01068b7:	90                   	nop
c01068b8:	5d                   	pop    %ebp
c01068b9:	c3                   	ret    

c01068ba <get_page>:

//get_page - get related Page struct for linear address la using PDT pgdir
struct Page *
get_page(pde_t *pgdir, uintptr_t la, pte_t **ptep_store) {
c01068ba:	f3 0f 1e fb          	endbr32 
c01068be:	55                   	push   %ebp
c01068bf:	89 e5                	mov    %esp,%ebp
c01068c1:	83 ec 18             	sub    $0x18,%esp
    pte_t *ptep = get_pte(pgdir, la, 0);
c01068c4:	6a 00                	push   $0x0
c01068c6:	ff 75 0c             	pushl  0xc(%ebp)
c01068c9:	ff 75 08             	pushl  0x8(%ebp)
c01068cc:	e8 df ff ff ff       	call   c01068b0 <get_pte>
c01068d1:	83 c4 0c             	add    $0xc,%esp
c01068d4:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (ptep_store != NULL) {
c01068d7:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c01068db:	74 08                	je     c01068e5 <get_page+0x2b>
        *ptep_store = ptep;
c01068dd:	8b 45 10             	mov    0x10(%ebp),%eax
c01068e0:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01068e3:	89 10                	mov    %edx,(%eax)
    }
    if (ptep != NULL && *ptep & PTE_P) {
c01068e5:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01068e9:	74 1f                	je     c010690a <get_page+0x50>
c01068eb:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01068ee:	8b 00                	mov    (%eax),%eax
c01068f0:	83 e0 01             	and    $0x1,%eax
c01068f3:	85 c0                	test   %eax,%eax
c01068f5:	74 13                	je     c010690a <get_page+0x50>
        return pte2page(*ptep);
c01068f7:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01068fa:	8b 00                	mov    (%eax),%eax
c01068fc:	83 ec 0c             	sub    $0xc,%esp
c01068ff:	50                   	push   %eax
c0106900:	e8 df f6 ff ff       	call   c0105fe4 <pte2page>
c0106905:	83 c4 10             	add    $0x10,%esp
c0106908:	eb 05                	jmp    c010690f <get_page+0x55>
    }
    return NULL;
c010690a:	b8 00 00 00 00       	mov    $0x0,%eax
}
c010690f:	c9                   	leave  
c0106910:	c3                   	ret    

c0106911 <page_remove_pte>:

//page_remove_pte - free an Page sturct which is related linear address la
//                - and clean(invalidate) pte which is related linear address la
//note: PT is changed, so the TLB need to be invalidate 
static inline void
page_remove_pte(pde_t *pgdir, uintptr_t la, pte_t *ptep) {
c0106911:	55                   	push   %ebp
c0106912:	89 e5                	mov    %esp,%ebp
                                  //(5) clear second page table entry
                                  //(6) flush tlb
    }
#endif

}
c0106914:	90                   	nop
c0106915:	5d                   	pop    %ebp
c0106916:	c3                   	ret    

c0106917 <page_remove>:

//page_remove - free an Page which is related linear address la and has an validated pte
void
page_remove(pde_t *pgdir, uintptr_t la) {
c0106917:	f3 0f 1e fb          	endbr32 
c010691b:	55                   	push   %ebp
c010691c:	89 e5                	mov    %esp,%ebp
c010691e:	83 ec 10             	sub    $0x10,%esp
    pte_t *ptep = get_pte(pgdir, la, 0);
c0106921:	6a 00                	push   $0x0
c0106923:	ff 75 0c             	pushl  0xc(%ebp)
c0106926:	ff 75 08             	pushl  0x8(%ebp)
c0106929:	e8 82 ff ff ff       	call   c01068b0 <get_pte>
c010692e:	83 c4 0c             	add    $0xc,%esp
c0106931:	89 45 fc             	mov    %eax,-0x4(%ebp)
    if (ptep != NULL) {
c0106934:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
c0106938:	74 11                	je     c010694b <page_remove+0x34>
        page_remove_pte(pgdir, la, ptep);
c010693a:	ff 75 fc             	pushl  -0x4(%ebp)
c010693d:	ff 75 0c             	pushl  0xc(%ebp)
c0106940:	ff 75 08             	pushl  0x8(%ebp)
c0106943:	e8 c9 ff ff ff       	call   c0106911 <page_remove_pte>
c0106948:	83 c4 0c             	add    $0xc,%esp
    }
}
c010694b:	90                   	nop
c010694c:	c9                   	leave  
c010694d:	c3                   	ret    

c010694e <page_insert>:
//  la:    the linear address need to map
//  perm:  the permission of this Page which is setted in related pte
// return value: always 0
//note: PT is changed, so the TLB need to be invalidate 
int
page_insert(pde_t *pgdir, struct Page *page, uintptr_t la, uint32_t perm) {
c010694e:	f3 0f 1e fb          	endbr32 
c0106952:	55                   	push   %ebp
c0106953:	89 e5                	mov    %esp,%ebp
c0106955:	83 ec 18             	sub    $0x18,%esp
    pte_t *ptep = get_pte(pgdir, la, 1);
c0106958:	6a 01                	push   $0x1
c010695a:	ff 75 10             	pushl  0x10(%ebp)
c010695d:	ff 75 08             	pushl  0x8(%ebp)
c0106960:	e8 4b ff ff ff       	call   c01068b0 <get_pte>
c0106965:	83 c4 0c             	add    $0xc,%esp
c0106968:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (ptep == NULL) {
c010696b:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c010696f:	75 0a                	jne    c010697b <page_insert+0x2d>
        return -E_NO_MEM;
c0106971:	b8 fc ff ff ff       	mov    $0xfffffffc,%eax
c0106976:	e9 88 00 00 00       	jmp    c0106a03 <page_insert+0xb5>
    }
    page_ref_inc(page);
c010697b:	ff 75 0c             	pushl  0xc(%ebp)
c010697e:	e8 c1 f6 ff ff       	call   c0106044 <page_ref_inc>
c0106983:	83 c4 04             	add    $0x4,%esp
    if (*ptep & PTE_P) {
c0106986:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106989:	8b 00                	mov    (%eax),%eax
c010698b:	83 e0 01             	and    $0x1,%eax
c010698e:	85 c0                	test   %eax,%eax
c0106990:	74 40                	je     c01069d2 <page_insert+0x84>
        struct Page *p = pte2page(*ptep);
c0106992:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106995:	8b 00                	mov    (%eax),%eax
c0106997:	83 ec 0c             	sub    $0xc,%esp
c010699a:	50                   	push   %eax
c010699b:	e8 44 f6 ff ff       	call   c0105fe4 <pte2page>
c01069a0:	83 c4 10             	add    $0x10,%esp
c01069a3:	89 45 f0             	mov    %eax,-0x10(%ebp)
        if (p == page) {
c01069a6:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01069a9:	3b 45 0c             	cmp    0xc(%ebp),%eax
c01069ac:	75 10                	jne    c01069be <page_insert+0x70>
            page_ref_dec(page);
c01069ae:	83 ec 0c             	sub    $0xc,%esp
c01069b1:	ff 75 0c             	pushl  0xc(%ebp)
c01069b4:	e8 a2 f6 ff ff       	call   c010605b <page_ref_dec>
c01069b9:	83 c4 10             	add    $0x10,%esp
c01069bc:	eb 14                	jmp    c01069d2 <page_insert+0x84>
        }
        else {
            page_remove_pte(pgdir, la, ptep);
c01069be:	83 ec 04             	sub    $0x4,%esp
c01069c1:	ff 75 f4             	pushl  -0xc(%ebp)
c01069c4:	ff 75 10             	pushl  0x10(%ebp)
c01069c7:	ff 75 08             	pushl  0x8(%ebp)
c01069ca:	e8 42 ff ff ff       	call   c0106911 <page_remove_pte>
c01069cf:	83 c4 10             	add    $0x10,%esp
        }
    }
    *ptep = page2pa(page) | PTE_P | perm;
c01069d2:	83 ec 0c             	sub    $0xc,%esp
c01069d5:	ff 75 0c             	pushl  0xc(%ebp)
c01069d8:	e8 33 f5 ff ff       	call   c0105f10 <page2pa>
c01069dd:	83 c4 10             	add    $0x10,%esp
c01069e0:	0b 45 14             	or     0x14(%ebp),%eax
c01069e3:	83 c8 01             	or     $0x1,%eax
c01069e6:	89 c2                	mov    %eax,%edx
c01069e8:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01069eb:	89 10                	mov    %edx,(%eax)
    tlb_invalidate(pgdir, la);
c01069ed:	83 ec 08             	sub    $0x8,%esp
c01069f0:	ff 75 10             	pushl  0x10(%ebp)
c01069f3:	ff 75 08             	pushl  0x8(%ebp)
c01069f6:	e8 0a 00 00 00       	call   c0106a05 <tlb_invalidate>
c01069fb:	83 c4 10             	add    $0x10,%esp
    return 0;
c01069fe:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0106a03:	c9                   	leave  
c0106a04:	c3                   	ret    

c0106a05 <tlb_invalidate>:
// edited are the ones currently in use by the processor.
// TLB是页表的缓冲，我们需要保证页表与TLB之间的一致性
// 因此，在更新页表内容时候，我们需要调用tlb_invalidate()使得硬件意识到当前的tlb数据的更新可能落后与页表
// 在X86架构中，写入TLB数据等操作是由硬件自动完成的，操作系统只需要在适当的时候使得TLB无效
void
tlb_invalidate(pde_t *pgdir, uintptr_t la) {
c0106a05:	f3 0f 1e fb          	endbr32 
c0106a09:	55                   	push   %ebp
c0106a0a:	89 e5                	mov    %esp,%ebp
c0106a0c:	83 ec 18             	sub    $0x18,%esp
}

static inline uintptr_t
rcr3(void) {
    uintptr_t cr3;
    asm volatile ("mov %%cr3, %0" : "=r" (cr3) :: "memory");
c0106a0f:	0f 20 d8             	mov    %cr3,%eax
c0106a12:	89 45 f0             	mov    %eax,-0x10(%ebp)
    return cr3;
c0106a15:	8b 55 f0             	mov    -0x10(%ebp),%edx
    if (rcr3() == PADDR(pgdir)) {
c0106a18:	8b 45 08             	mov    0x8(%ebp),%eax
c0106a1b:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0106a1e:	81 7d f4 ff ff ff bf 	cmpl   $0xbfffffff,-0xc(%ebp)
c0106a25:	77 17                	ja     c0106a3e <tlb_invalidate+0x39>
c0106a27:	ff 75 f4             	pushl  -0xc(%ebp)
c0106a2a:	68 14 9d 10 c0       	push   $0xc0109d14
c0106a2f:	68 d7 01 00 00       	push   $0x1d7
c0106a34:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106a39:	e8 e7 99 ff ff       	call   c0100425 <__panic>
c0106a3e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106a41:	05 00 00 00 40       	add    $0x40000000,%eax
c0106a46:	39 d0                	cmp    %edx,%eax
c0106a48:	75 0d                	jne    c0106a57 <tlb_invalidate+0x52>
        invlpg((void *)la);
c0106a4a:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106a4d:	89 45 ec             	mov    %eax,-0x14(%ebp)
}

static inline void
invlpg(void *addr) {
    asm volatile ("invlpg (%0)" :: "r" (addr) : "memory");
c0106a50:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0106a53:	0f 01 38             	invlpg (%eax)
}
c0106a56:	90                   	nop
    }
}
c0106a57:	90                   	nop
c0106a58:	c9                   	leave  
c0106a59:	c3                   	ret    

c0106a5a <pgdir_alloc_page>:

// pgdir_alloc_page - call alloc_page & page_insert functions to 
//                  - allocate a page size memory & setup an addr map
//                  - pa<->la with linear address la and the PDT pgdir
struct Page *
pgdir_alloc_page(pde_t *pgdir, uintptr_t la, uint32_t perm) {
c0106a5a:	f3 0f 1e fb          	endbr32 
c0106a5e:	55                   	push   %ebp
c0106a5f:	89 e5                	mov    %esp,%ebp
c0106a61:	83 ec 18             	sub    $0x18,%esp
    struct Page *page = alloc_page();
c0106a64:	83 ec 0c             	sub    $0xc,%esp
c0106a67:	6a 01                	push   $0x1
c0106a69:	e8 dd f7 ff ff       	call   c010624b <alloc_pages>
c0106a6e:	83 c4 10             	add    $0x10,%esp
c0106a71:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (page != NULL) {
c0106a74:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0106a78:	0f 84 83 00 00 00    	je     c0106b01 <pgdir_alloc_page+0xa7>
        if (page_insert(pgdir, page, la, perm) != 0) {
c0106a7e:	ff 75 10             	pushl  0x10(%ebp)
c0106a81:	ff 75 0c             	pushl  0xc(%ebp)
c0106a84:	ff 75 f4             	pushl  -0xc(%ebp)
c0106a87:	ff 75 08             	pushl  0x8(%ebp)
c0106a8a:	e8 bf fe ff ff       	call   c010694e <page_insert>
c0106a8f:	83 c4 10             	add    $0x10,%esp
c0106a92:	85 c0                	test   %eax,%eax
c0106a94:	74 17                	je     c0106aad <pgdir_alloc_page+0x53>
            free_page(page);
c0106a96:	83 ec 08             	sub    $0x8,%esp
c0106a99:	6a 01                	push   $0x1
c0106a9b:	ff 75 f4             	pushl  -0xc(%ebp)
c0106a9e:	e8 18 f8 ff ff       	call   c01062bb <free_pages>
c0106aa3:	83 c4 10             	add    $0x10,%esp
            return NULL;
c0106aa6:	b8 00 00 00 00       	mov    $0x0,%eax
c0106aab:	eb 57                	jmp    c0106b04 <pgdir_alloc_page+0xaa>
        }
        if (swap_init_ok){
c0106aad:	a1 68 5f 12 c0       	mov    0xc0125f68,%eax
c0106ab2:	85 c0                	test   %eax,%eax
c0106ab4:	74 4b                	je     c0106b01 <pgdir_alloc_page+0xa7>
            swap_map_swappable(check_mm_struct, la, page, 0);
c0106ab6:	a1 10 60 12 c0       	mov    0xc0126010,%eax
c0106abb:	6a 00                	push   $0x0
c0106abd:	ff 75 f4             	pushl  -0xc(%ebp)
c0106ac0:	ff 75 0c             	pushl  0xc(%ebp)
c0106ac3:	50                   	push   %eax
c0106ac4:	e8 d8 d9 ff ff       	call   c01044a1 <swap_map_swappable>
c0106ac9:	83 c4 10             	add    $0x10,%esp
            page->pra_vaddr=la;
c0106acc:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106acf:	8b 55 0c             	mov    0xc(%ebp),%edx
c0106ad2:	89 50 1c             	mov    %edx,0x1c(%eax)
            assert(page_ref(page) == 1);
c0106ad5:	83 ec 0c             	sub    $0xc,%esp
c0106ad8:	ff 75 f4             	pushl  -0xc(%ebp)
c0106adb:	e8 5a f5 ff ff       	call   c010603a <page_ref>
c0106ae0:	83 c4 10             	add    $0x10,%esp
c0106ae3:	83 f8 01             	cmp    $0x1,%eax
c0106ae6:	74 19                	je     c0106b01 <pgdir_alloc_page+0xa7>
c0106ae8:	68 18 9e 10 c0       	push   $0xc0109e18
c0106aed:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106af2:	68 ea 01 00 00       	push   $0x1ea
c0106af7:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106afc:	e8 24 99 ff ff       	call   c0100425 <__panic>
            //cprintf("get No. %d  page: pra_vaddr %x, pra_link.prev %x, pra_link_next %x in pgdir_alloc_page\n", (page-pages), page->pra_vaddr,page->pra_page_link.prev, page->pra_page_link.next);
        }

    }

    return page;
c0106b01:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0106b04:	c9                   	leave  
c0106b05:	c3                   	ret    

c0106b06 <check_alloc_page>:

static void
check_alloc_page(void) {
c0106b06:	f3 0f 1e fb          	endbr32 
c0106b0a:	55                   	push   %ebp
c0106b0b:	89 e5                	mov    %esp,%ebp
c0106b0d:	83 ec 08             	sub    $0x8,%esp
    pmm_manager->check();
c0106b10:	a1 f0 60 12 c0       	mov    0xc01260f0,%eax
c0106b15:	8b 40 18             	mov    0x18(%eax),%eax
c0106b18:	ff d0                	call   *%eax
    cprintf("check_alloc_page() succeeded!\n");
c0106b1a:	83 ec 0c             	sub    $0xc,%esp
c0106b1d:	68 2c 9e 10 c0       	push   $0xc0109e2c
c0106b22:	e8 83 97 ff ff       	call   c01002aa <cprintf>
c0106b27:	83 c4 10             	add    $0x10,%esp
}
c0106b2a:	90                   	nop
c0106b2b:	c9                   	leave  
c0106b2c:	c3                   	ret    

c0106b2d <check_pgdir>:

static void
check_pgdir(void) {
c0106b2d:	f3 0f 1e fb          	endbr32 
c0106b31:	55                   	push   %ebp
c0106b32:	89 e5                	mov    %esp,%ebp
c0106b34:	83 ec 28             	sub    $0x28,%esp
    assert(npage <= KMEMSIZE / PGSIZE);
c0106b37:	a1 80 5f 12 c0       	mov    0xc0125f80,%eax
c0106b3c:	3d 00 80 03 00       	cmp    $0x38000,%eax
c0106b41:	76 19                	jbe    c0106b5c <check_pgdir+0x2f>
c0106b43:	68 4b 9e 10 c0       	push   $0xc0109e4b
c0106b48:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106b4d:	68 fb 01 00 00       	push   $0x1fb
c0106b52:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106b57:	e8 c9 98 ff ff       	call   c0100425 <__panic>
    assert(boot_pgdir != NULL && (uint32_t)PGOFF(boot_pgdir) == 0);
c0106b5c:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0106b61:	85 c0                	test   %eax,%eax
c0106b63:	74 0e                	je     c0106b73 <check_pgdir+0x46>
c0106b65:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0106b6a:	25 ff 0f 00 00       	and    $0xfff,%eax
c0106b6f:	85 c0                	test   %eax,%eax
c0106b71:	74 19                	je     c0106b8c <check_pgdir+0x5f>
c0106b73:	68 68 9e 10 c0       	push   $0xc0109e68
c0106b78:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106b7d:	68 fc 01 00 00       	push   $0x1fc
c0106b82:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106b87:	e8 99 98 ff ff       	call   c0100425 <__panic>
    assert(get_page(boot_pgdir, 0x0, NULL) == NULL);
c0106b8c:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0106b91:	83 ec 04             	sub    $0x4,%esp
c0106b94:	6a 00                	push   $0x0
c0106b96:	6a 00                	push   $0x0
c0106b98:	50                   	push   %eax
c0106b99:	e8 1c fd ff ff       	call   c01068ba <get_page>
c0106b9e:	83 c4 10             	add    $0x10,%esp
c0106ba1:	85 c0                	test   %eax,%eax
c0106ba3:	74 19                	je     c0106bbe <check_pgdir+0x91>
c0106ba5:	68 a0 9e 10 c0       	push   $0xc0109ea0
c0106baa:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106baf:	68 fd 01 00 00       	push   $0x1fd
c0106bb4:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106bb9:	e8 67 98 ff ff       	call   c0100425 <__panic>

    struct Page *p1, *p2;
    p1 = alloc_page();
c0106bbe:	83 ec 0c             	sub    $0xc,%esp
c0106bc1:	6a 01                	push   $0x1
c0106bc3:	e8 83 f6 ff ff       	call   c010624b <alloc_pages>
c0106bc8:	83 c4 10             	add    $0x10,%esp
c0106bcb:	89 45 f4             	mov    %eax,-0xc(%ebp)
    assert(page_insert(boot_pgdir, p1, 0x0, 0) == 0);
c0106bce:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0106bd3:	6a 00                	push   $0x0
c0106bd5:	6a 00                	push   $0x0
c0106bd7:	ff 75 f4             	pushl  -0xc(%ebp)
c0106bda:	50                   	push   %eax
c0106bdb:	e8 6e fd ff ff       	call   c010694e <page_insert>
c0106be0:	83 c4 10             	add    $0x10,%esp
c0106be3:	85 c0                	test   %eax,%eax
c0106be5:	74 19                	je     c0106c00 <check_pgdir+0xd3>
c0106be7:	68 c8 9e 10 c0       	push   $0xc0109ec8
c0106bec:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106bf1:	68 01 02 00 00       	push   $0x201
c0106bf6:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106bfb:	e8 25 98 ff ff       	call   c0100425 <__panic>

    pte_t *ptep;
    assert((ptep = get_pte(boot_pgdir, 0x0, 0)) != NULL);
c0106c00:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0106c05:	83 ec 04             	sub    $0x4,%esp
c0106c08:	6a 00                	push   $0x0
c0106c0a:	6a 00                	push   $0x0
c0106c0c:	50                   	push   %eax
c0106c0d:	e8 9e fc ff ff       	call   c01068b0 <get_pte>
c0106c12:	83 c4 10             	add    $0x10,%esp
c0106c15:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0106c18:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0106c1c:	75 19                	jne    c0106c37 <check_pgdir+0x10a>
c0106c1e:	68 f4 9e 10 c0       	push   $0xc0109ef4
c0106c23:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106c28:	68 04 02 00 00       	push   $0x204
c0106c2d:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106c32:	e8 ee 97 ff ff       	call   c0100425 <__panic>
    assert(pte2page(*ptep) == p1);
c0106c37:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0106c3a:	8b 00                	mov    (%eax),%eax
c0106c3c:	83 ec 0c             	sub    $0xc,%esp
c0106c3f:	50                   	push   %eax
c0106c40:	e8 9f f3 ff ff       	call   c0105fe4 <pte2page>
c0106c45:	83 c4 10             	add    $0x10,%esp
c0106c48:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0106c4b:	74 19                	je     c0106c66 <check_pgdir+0x139>
c0106c4d:	68 21 9f 10 c0       	push   $0xc0109f21
c0106c52:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106c57:	68 05 02 00 00       	push   $0x205
c0106c5c:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106c61:	e8 bf 97 ff ff       	call   c0100425 <__panic>
    assert(page_ref(p1) == 1);
c0106c66:	83 ec 0c             	sub    $0xc,%esp
c0106c69:	ff 75 f4             	pushl  -0xc(%ebp)
c0106c6c:	e8 c9 f3 ff ff       	call   c010603a <page_ref>
c0106c71:	83 c4 10             	add    $0x10,%esp
c0106c74:	83 f8 01             	cmp    $0x1,%eax
c0106c77:	74 19                	je     c0106c92 <check_pgdir+0x165>
c0106c79:	68 37 9f 10 c0       	push   $0xc0109f37
c0106c7e:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106c83:	68 06 02 00 00       	push   $0x206
c0106c88:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106c8d:	e8 93 97 ff ff       	call   c0100425 <__panic>

    ptep = &((pte_t *)KADDR(PDE_ADDR(boot_pgdir[0])))[1];
c0106c92:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0106c97:	8b 00                	mov    (%eax),%eax
c0106c99:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0106c9e:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0106ca1:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0106ca4:	c1 e8 0c             	shr    $0xc,%eax
c0106ca7:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0106caa:	a1 80 5f 12 c0       	mov    0xc0125f80,%eax
c0106caf:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c0106cb2:	72 17                	jb     c0106ccb <check_pgdir+0x19e>
c0106cb4:	ff 75 ec             	pushl  -0x14(%ebp)
c0106cb7:	68 f0 9c 10 c0       	push   $0xc0109cf0
c0106cbc:	68 08 02 00 00       	push   $0x208
c0106cc1:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106cc6:	e8 5a 97 ff ff       	call   c0100425 <__panic>
c0106ccb:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0106cce:	2d 00 00 00 40       	sub    $0x40000000,%eax
c0106cd3:	83 c0 04             	add    $0x4,%eax
c0106cd6:	89 45 f0             	mov    %eax,-0x10(%ebp)
    assert(get_pte(boot_pgdir, PGSIZE, 0) == ptep);
c0106cd9:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0106cde:	83 ec 04             	sub    $0x4,%esp
c0106ce1:	6a 00                	push   $0x0
c0106ce3:	68 00 10 00 00       	push   $0x1000
c0106ce8:	50                   	push   %eax
c0106ce9:	e8 c2 fb ff ff       	call   c01068b0 <get_pte>
c0106cee:	83 c4 10             	add    $0x10,%esp
c0106cf1:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c0106cf4:	74 19                	je     c0106d0f <check_pgdir+0x1e2>
c0106cf6:	68 4c 9f 10 c0       	push   $0xc0109f4c
c0106cfb:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106d00:	68 09 02 00 00       	push   $0x209
c0106d05:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106d0a:	e8 16 97 ff ff       	call   c0100425 <__panic>

    p2 = alloc_page();
c0106d0f:	83 ec 0c             	sub    $0xc,%esp
c0106d12:	6a 01                	push   $0x1
c0106d14:	e8 32 f5 ff ff       	call   c010624b <alloc_pages>
c0106d19:	83 c4 10             	add    $0x10,%esp
c0106d1c:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    assert(page_insert(boot_pgdir, p2, PGSIZE, PTE_U | PTE_W) == 0);
c0106d1f:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0106d24:	6a 06                	push   $0x6
c0106d26:	68 00 10 00 00       	push   $0x1000
c0106d2b:	ff 75 e4             	pushl  -0x1c(%ebp)
c0106d2e:	50                   	push   %eax
c0106d2f:	e8 1a fc ff ff       	call   c010694e <page_insert>
c0106d34:	83 c4 10             	add    $0x10,%esp
c0106d37:	85 c0                	test   %eax,%eax
c0106d39:	74 19                	je     c0106d54 <check_pgdir+0x227>
c0106d3b:	68 74 9f 10 c0       	push   $0xc0109f74
c0106d40:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106d45:	68 0c 02 00 00       	push   $0x20c
c0106d4a:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106d4f:	e8 d1 96 ff ff       	call   c0100425 <__panic>
    assert((ptep = get_pte(boot_pgdir, PGSIZE, 0)) != NULL);
c0106d54:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0106d59:	83 ec 04             	sub    $0x4,%esp
c0106d5c:	6a 00                	push   $0x0
c0106d5e:	68 00 10 00 00       	push   $0x1000
c0106d63:	50                   	push   %eax
c0106d64:	e8 47 fb ff ff       	call   c01068b0 <get_pte>
c0106d69:	83 c4 10             	add    $0x10,%esp
c0106d6c:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0106d6f:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0106d73:	75 19                	jne    c0106d8e <check_pgdir+0x261>
c0106d75:	68 ac 9f 10 c0       	push   $0xc0109fac
c0106d7a:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106d7f:	68 0d 02 00 00       	push   $0x20d
c0106d84:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106d89:	e8 97 96 ff ff       	call   c0100425 <__panic>
    assert(*ptep & PTE_U);
c0106d8e:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0106d91:	8b 00                	mov    (%eax),%eax
c0106d93:	83 e0 04             	and    $0x4,%eax
c0106d96:	85 c0                	test   %eax,%eax
c0106d98:	75 19                	jne    c0106db3 <check_pgdir+0x286>
c0106d9a:	68 dc 9f 10 c0       	push   $0xc0109fdc
c0106d9f:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106da4:	68 0e 02 00 00       	push   $0x20e
c0106da9:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106dae:	e8 72 96 ff ff       	call   c0100425 <__panic>
    assert(*ptep & PTE_W);
c0106db3:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0106db6:	8b 00                	mov    (%eax),%eax
c0106db8:	83 e0 02             	and    $0x2,%eax
c0106dbb:	85 c0                	test   %eax,%eax
c0106dbd:	75 19                	jne    c0106dd8 <check_pgdir+0x2ab>
c0106dbf:	68 ea 9f 10 c0       	push   $0xc0109fea
c0106dc4:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106dc9:	68 0f 02 00 00       	push   $0x20f
c0106dce:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106dd3:	e8 4d 96 ff ff       	call   c0100425 <__panic>
    assert(boot_pgdir[0] & PTE_U);
c0106dd8:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0106ddd:	8b 00                	mov    (%eax),%eax
c0106ddf:	83 e0 04             	and    $0x4,%eax
c0106de2:	85 c0                	test   %eax,%eax
c0106de4:	75 19                	jne    c0106dff <check_pgdir+0x2d2>
c0106de6:	68 f8 9f 10 c0       	push   $0xc0109ff8
c0106deb:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106df0:	68 10 02 00 00       	push   $0x210
c0106df5:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106dfa:	e8 26 96 ff ff       	call   c0100425 <__panic>
    assert(page_ref(p2) == 1);
c0106dff:	83 ec 0c             	sub    $0xc,%esp
c0106e02:	ff 75 e4             	pushl  -0x1c(%ebp)
c0106e05:	e8 30 f2 ff ff       	call   c010603a <page_ref>
c0106e0a:	83 c4 10             	add    $0x10,%esp
c0106e0d:	83 f8 01             	cmp    $0x1,%eax
c0106e10:	74 19                	je     c0106e2b <check_pgdir+0x2fe>
c0106e12:	68 0e a0 10 c0       	push   $0xc010a00e
c0106e17:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106e1c:	68 11 02 00 00       	push   $0x211
c0106e21:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106e26:	e8 fa 95 ff ff       	call   c0100425 <__panic>

    assert(page_insert(boot_pgdir, p1, PGSIZE, 0) == 0);
c0106e2b:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0106e30:	6a 00                	push   $0x0
c0106e32:	68 00 10 00 00       	push   $0x1000
c0106e37:	ff 75 f4             	pushl  -0xc(%ebp)
c0106e3a:	50                   	push   %eax
c0106e3b:	e8 0e fb ff ff       	call   c010694e <page_insert>
c0106e40:	83 c4 10             	add    $0x10,%esp
c0106e43:	85 c0                	test   %eax,%eax
c0106e45:	74 19                	je     c0106e60 <check_pgdir+0x333>
c0106e47:	68 20 a0 10 c0       	push   $0xc010a020
c0106e4c:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106e51:	68 13 02 00 00       	push   $0x213
c0106e56:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106e5b:	e8 c5 95 ff ff       	call   c0100425 <__panic>
    assert(page_ref(p1) == 2);
c0106e60:	83 ec 0c             	sub    $0xc,%esp
c0106e63:	ff 75 f4             	pushl  -0xc(%ebp)
c0106e66:	e8 cf f1 ff ff       	call   c010603a <page_ref>
c0106e6b:	83 c4 10             	add    $0x10,%esp
c0106e6e:	83 f8 02             	cmp    $0x2,%eax
c0106e71:	74 19                	je     c0106e8c <check_pgdir+0x35f>
c0106e73:	68 4c a0 10 c0       	push   $0xc010a04c
c0106e78:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106e7d:	68 14 02 00 00       	push   $0x214
c0106e82:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106e87:	e8 99 95 ff ff       	call   c0100425 <__panic>
    assert(page_ref(p2) == 0);
c0106e8c:	83 ec 0c             	sub    $0xc,%esp
c0106e8f:	ff 75 e4             	pushl  -0x1c(%ebp)
c0106e92:	e8 a3 f1 ff ff       	call   c010603a <page_ref>
c0106e97:	83 c4 10             	add    $0x10,%esp
c0106e9a:	85 c0                	test   %eax,%eax
c0106e9c:	74 19                	je     c0106eb7 <check_pgdir+0x38a>
c0106e9e:	68 5e a0 10 c0       	push   $0xc010a05e
c0106ea3:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106ea8:	68 15 02 00 00       	push   $0x215
c0106ead:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106eb2:	e8 6e 95 ff ff       	call   c0100425 <__panic>
    assert((ptep = get_pte(boot_pgdir, PGSIZE, 0)) != NULL);
c0106eb7:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0106ebc:	83 ec 04             	sub    $0x4,%esp
c0106ebf:	6a 00                	push   $0x0
c0106ec1:	68 00 10 00 00       	push   $0x1000
c0106ec6:	50                   	push   %eax
c0106ec7:	e8 e4 f9 ff ff       	call   c01068b0 <get_pte>
c0106ecc:	83 c4 10             	add    $0x10,%esp
c0106ecf:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0106ed2:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0106ed6:	75 19                	jne    c0106ef1 <check_pgdir+0x3c4>
c0106ed8:	68 ac 9f 10 c0       	push   $0xc0109fac
c0106edd:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106ee2:	68 16 02 00 00       	push   $0x216
c0106ee7:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106eec:	e8 34 95 ff ff       	call   c0100425 <__panic>
    assert(pte2page(*ptep) == p1);
c0106ef1:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0106ef4:	8b 00                	mov    (%eax),%eax
c0106ef6:	83 ec 0c             	sub    $0xc,%esp
c0106ef9:	50                   	push   %eax
c0106efa:	e8 e5 f0 ff ff       	call   c0105fe4 <pte2page>
c0106eff:	83 c4 10             	add    $0x10,%esp
c0106f02:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0106f05:	74 19                	je     c0106f20 <check_pgdir+0x3f3>
c0106f07:	68 21 9f 10 c0       	push   $0xc0109f21
c0106f0c:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106f11:	68 17 02 00 00       	push   $0x217
c0106f16:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106f1b:	e8 05 95 ff ff       	call   c0100425 <__panic>
    assert((*ptep & PTE_U) == 0);
c0106f20:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0106f23:	8b 00                	mov    (%eax),%eax
c0106f25:	83 e0 04             	and    $0x4,%eax
c0106f28:	85 c0                	test   %eax,%eax
c0106f2a:	74 19                	je     c0106f45 <check_pgdir+0x418>
c0106f2c:	68 70 a0 10 c0       	push   $0xc010a070
c0106f31:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106f36:	68 18 02 00 00       	push   $0x218
c0106f3b:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106f40:	e8 e0 94 ff ff       	call   c0100425 <__panic>

    page_remove(boot_pgdir, 0x0);
c0106f45:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0106f4a:	83 ec 08             	sub    $0x8,%esp
c0106f4d:	6a 00                	push   $0x0
c0106f4f:	50                   	push   %eax
c0106f50:	e8 c2 f9 ff ff       	call   c0106917 <page_remove>
c0106f55:	83 c4 10             	add    $0x10,%esp
    assert(page_ref(p1) == 1);
c0106f58:	83 ec 0c             	sub    $0xc,%esp
c0106f5b:	ff 75 f4             	pushl  -0xc(%ebp)
c0106f5e:	e8 d7 f0 ff ff       	call   c010603a <page_ref>
c0106f63:	83 c4 10             	add    $0x10,%esp
c0106f66:	83 f8 01             	cmp    $0x1,%eax
c0106f69:	74 19                	je     c0106f84 <check_pgdir+0x457>
c0106f6b:	68 37 9f 10 c0       	push   $0xc0109f37
c0106f70:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106f75:	68 1b 02 00 00       	push   $0x21b
c0106f7a:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106f7f:	e8 a1 94 ff ff       	call   c0100425 <__panic>
    assert(page_ref(p2) == 0);
c0106f84:	83 ec 0c             	sub    $0xc,%esp
c0106f87:	ff 75 e4             	pushl  -0x1c(%ebp)
c0106f8a:	e8 ab f0 ff ff       	call   c010603a <page_ref>
c0106f8f:	83 c4 10             	add    $0x10,%esp
c0106f92:	85 c0                	test   %eax,%eax
c0106f94:	74 19                	je     c0106faf <check_pgdir+0x482>
c0106f96:	68 5e a0 10 c0       	push   $0xc010a05e
c0106f9b:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106fa0:	68 1c 02 00 00       	push   $0x21c
c0106fa5:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106faa:	e8 76 94 ff ff       	call   c0100425 <__panic>

    page_remove(boot_pgdir, PGSIZE);
c0106faf:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0106fb4:	83 ec 08             	sub    $0x8,%esp
c0106fb7:	68 00 10 00 00       	push   $0x1000
c0106fbc:	50                   	push   %eax
c0106fbd:	e8 55 f9 ff ff       	call   c0106917 <page_remove>
c0106fc2:	83 c4 10             	add    $0x10,%esp
    assert(page_ref(p1) == 0);
c0106fc5:	83 ec 0c             	sub    $0xc,%esp
c0106fc8:	ff 75 f4             	pushl  -0xc(%ebp)
c0106fcb:	e8 6a f0 ff ff       	call   c010603a <page_ref>
c0106fd0:	83 c4 10             	add    $0x10,%esp
c0106fd3:	85 c0                	test   %eax,%eax
c0106fd5:	74 19                	je     c0106ff0 <check_pgdir+0x4c3>
c0106fd7:	68 85 a0 10 c0       	push   $0xc010a085
c0106fdc:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0106fe1:	68 1f 02 00 00       	push   $0x21f
c0106fe6:	68 b8 9d 10 c0       	push   $0xc0109db8
c0106feb:	e8 35 94 ff ff       	call   c0100425 <__panic>
    assert(page_ref(p2) == 0);
c0106ff0:	83 ec 0c             	sub    $0xc,%esp
c0106ff3:	ff 75 e4             	pushl  -0x1c(%ebp)
c0106ff6:	e8 3f f0 ff ff       	call   c010603a <page_ref>
c0106ffb:	83 c4 10             	add    $0x10,%esp
c0106ffe:	85 c0                	test   %eax,%eax
c0107000:	74 19                	je     c010701b <check_pgdir+0x4ee>
c0107002:	68 5e a0 10 c0       	push   $0xc010a05e
c0107007:	68 dd 9d 10 c0       	push   $0xc0109ddd
c010700c:	68 20 02 00 00       	push   $0x220
c0107011:	68 b8 9d 10 c0       	push   $0xc0109db8
c0107016:	e8 0a 94 ff ff       	call   c0100425 <__panic>

    assert(page_ref(pde2page(boot_pgdir[0])) == 1);
c010701b:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0107020:	8b 00                	mov    (%eax),%eax
c0107022:	83 ec 0c             	sub    $0xc,%esp
c0107025:	50                   	push   %eax
c0107026:	e8 f3 ef ff ff       	call   c010601e <pde2page>
c010702b:	83 c4 10             	add    $0x10,%esp
c010702e:	83 ec 0c             	sub    $0xc,%esp
c0107031:	50                   	push   %eax
c0107032:	e8 03 f0 ff ff       	call   c010603a <page_ref>
c0107037:	83 c4 10             	add    $0x10,%esp
c010703a:	83 f8 01             	cmp    $0x1,%eax
c010703d:	74 19                	je     c0107058 <check_pgdir+0x52b>
c010703f:	68 98 a0 10 c0       	push   $0xc010a098
c0107044:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0107049:	68 22 02 00 00       	push   $0x222
c010704e:	68 b8 9d 10 c0       	push   $0xc0109db8
c0107053:	e8 cd 93 ff ff       	call   c0100425 <__panic>
    free_page(pde2page(boot_pgdir[0]));
c0107058:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c010705d:	8b 00                	mov    (%eax),%eax
c010705f:	83 ec 0c             	sub    $0xc,%esp
c0107062:	50                   	push   %eax
c0107063:	e8 b6 ef ff ff       	call   c010601e <pde2page>
c0107068:	83 c4 10             	add    $0x10,%esp
c010706b:	83 ec 08             	sub    $0x8,%esp
c010706e:	6a 01                	push   $0x1
c0107070:	50                   	push   %eax
c0107071:	e8 45 f2 ff ff       	call   c01062bb <free_pages>
c0107076:	83 c4 10             	add    $0x10,%esp
    boot_pgdir[0] = 0;
c0107079:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c010707e:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    cprintf("check_pgdir() succeeded!\n");
c0107084:	83 ec 0c             	sub    $0xc,%esp
c0107087:	68 bf a0 10 c0       	push   $0xc010a0bf
c010708c:	e8 19 92 ff ff       	call   c01002aa <cprintf>
c0107091:	83 c4 10             	add    $0x10,%esp
}
c0107094:	90                   	nop
c0107095:	c9                   	leave  
c0107096:	c3                   	ret    

c0107097 <check_boot_pgdir>:

static void
check_boot_pgdir(void) {
c0107097:	f3 0f 1e fb          	endbr32 
c010709b:	55                   	push   %ebp
c010709c:	89 e5                	mov    %esp,%ebp
c010709e:	83 ec 28             	sub    $0x28,%esp
    pte_t *ptep;
    int i;
    for (i = 0; i < npage; i += PGSIZE) {
c01070a1:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c01070a8:	e9 a3 00 00 00       	jmp    c0107150 <check_boot_pgdir+0xb9>
        assert((ptep = get_pte(boot_pgdir, (uintptr_t)KADDR(i), 0)) != NULL);
c01070ad:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01070b0:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c01070b3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01070b6:	c1 e8 0c             	shr    $0xc,%eax
c01070b9:	89 45 e0             	mov    %eax,-0x20(%ebp)
c01070bc:	a1 80 5f 12 c0       	mov    0xc0125f80,%eax
c01070c1:	39 45 e0             	cmp    %eax,-0x20(%ebp)
c01070c4:	72 17                	jb     c01070dd <check_boot_pgdir+0x46>
c01070c6:	ff 75 e4             	pushl  -0x1c(%ebp)
c01070c9:	68 f0 9c 10 c0       	push   $0xc0109cf0
c01070ce:	68 2e 02 00 00       	push   $0x22e
c01070d3:	68 b8 9d 10 c0       	push   $0xc0109db8
c01070d8:	e8 48 93 ff ff       	call   c0100425 <__panic>
c01070dd:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01070e0:	2d 00 00 00 40       	sub    $0x40000000,%eax
c01070e5:	89 c2                	mov    %eax,%edx
c01070e7:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c01070ec:	83 ec 04             	sub    $0x4,%esp
c01070ef:	6a 00                	push   $0x0
c01070f1:	52                   	push   %edx
c01070f2:	50                   	push   %eax
c01070f3:	e8 b8 f7 ff ff       	call   c01068b0 <get_pte>
c01070f8:	83 c4 10             	add    $0x10,%esp
c01070fb:	89 45 dc             	mov    %eax,-0x24(%ebp)
c01070fe:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
c0107102:	75 19                	jne    c010711d <check_boot_pgdir+0x86>
c0107104:	68 dc a0 10 c0       	push   $0xc010a0dc
c0107109:	68 dd 9d 10 c0       	push   $0xc0109ddd
c010710e:	68 2e 02 00 00       	push   $0x22e
c0107113:	68 b8 9d 10 c0       	push   $0xc0109db8
c0107118:	e8 08 93 ff ff       	call   c0100425 <__panic>
        assert(PTE_ADDR(*ptep) == i);
c010711d:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0107120:	8b 00                	mov    (%eax),%eax
c0107122:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0107127:	89 c2                	mov    %eax,%edx
c0107129:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010712c:	39 c2                	cmp    %eax,%edx
c010712e:	74 19                	je     c0107149 <check_boot_pgdir+0xb2>
c0107130:	68 19 a1 10 c0       	push   $0xc010a119
c0107135:	68 dd 9d 10 c0       	push   $0xc0109ddd
c010713a:	68 2f 02 00 00       	push   $0x22f
c010713f:	68 b8 9d 10 c0       	push   $0xc0109db8
c0107144:	e8 dc 92 ff ff       	call   c0100425 <__panic>
    for (i = 0; i < npage; i += PGSIZE) {
c0107149:	81 45 f4 00 10 00 00 	addl   $0x1000,-0xc(%ebp)
c0107150:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0107153:	a1 80 5f 12 c0       	mov    0xc0125f80,%eax
c0107158:	39 c2                	cmp    %eax,%edx
c010715a:	0f 82 4d ff ff ff    	jb     c01070ad <check_boot_pgdir+0x16>
    }

    assert(PDE_ADDR(boot_pgdir[PDX(VPT)]) == PADDR(boot_pgdir));
c0107160:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0107165:	05 ac 0f 00 00       	add    $0xfac,%eax
c010716a:	8b 00                	mov    (%eax),%eax
c010716c:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0107171:	89 c2                	mov    %eax,%edx
c0107173:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c0107178:	89 45 f0             	mov    %eax,-0x10(%ebp)
c010717b:	81 7d f0 ff ff ff bf 	cmpl   $0xbfffffff,-0x10(%ebp)
c0107182:	77 17                	ja     c010719b <check_boot_pgdir+0x104>
c0107184:	ff 75 f0             	pushl  -0x10(%ebp)
c0107187:	68 14 9d 10 c0       	push   $0xc0109d14
c010718c:	68 32 02 00 00       	push   $0x232
c0107191:	68 b8 9d 10 c0       	push   $0xc0109db8
c0107196:	e8 8a 92 ff ff       	call   c0100425 <__panic>
c010719b:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010719e:	05 00 00 00 40       	add    $0x40000000,%eax
c01071a3:	39 d0                	cmp    %edx,%eax
c01071a5:	74 19                	je     c01071c0 <check_boot_pgdir+0x129>
c01071a7:	68 30 a1 10 c0       	push   $0xc010a130
c01071ac:	68 dd 9d 10 c0       	push   $0xc0109ddd
c01071b1:	68 32 02 00 00       	push   $0x232
c01071b6:	68 b8 9d 10 c0       	push   $0xc0109db8
c01071bb:	e8 65 92 ff ff       	call   c0100425 <__panic>

    assert(boot_pgdir[0] == 0);
c01071c0:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c01071c5:	8b 00                	mov    (%eax),%eax
c01071c7:	85 c0                	test   %eax,%eax
c01071c9:	74 19                	je     c01071e4 <check_boot_pgdir+0x14d>
c01071cb:	68 64 a1 10 c0       	push   $0xc010a164
c01071d0:	68 dd 9d 10 c0       	push   $0xc0109ddd
c01071d5:	68 34 02 00 00       	push   $0x234
c01071da:	68 b8 9d 10 c0       	push   $0xc0109db8
c01071df:	e8 41 92 ff ff       	call   c0100425 <__panic>

    struct Page *p;
    p = alloc_page();
c01071e4:	83 ec 0c             	sub    $0xc,%esp
c01071e7:	6a 01                	push   $0x1
c01071e9:	e8 5d f0 ff ff       	call   c010624b <alloc_pages>
c01071ee:	83 c4 10             	add    $0x10,%esp
c01071f1:	89 45 ec             	mov    %eax,-0x14(%ebp)
    assert(page_insert(boot_pgdir, p, 0x100, PTE_W) == 0);
c01071f4:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c01071f9:	6a 02                	push   $0x2
c01071fb:	68 00 01 00 00       	push   $0x100
c0107200:	ff 75 ec             	pushl  -0x14(%ebp)
c0107203:	50                   	push   %eax
c0107204:	e8 45 f7 ff ff       	call   c010694e <page_insert>
c0107209:	83 c4 10             	add    $0x10,%esp
c010720c:	85 c0                	test   %eax,%eax
c010720e:	74 19                	je     c0107229 <check_boot_pgdir+0x192>
c0107210:	68 78 a1 10 c0       	push   $0xc010a178
c0107215:	68 dd 9d 10 c0       	push   $0xc0109ddd
c010721a:	68 38 02 00 00       	push   $0x238
c010721f:	68 b8 9d 10 c0       	push   $0xc0109db8
c0107224:	e8 fc 91 ff ff       	call   c0100425 <__panic>
    assert(page_ref(p) == 1);
c0107229:	83 ec 0c             	sub    $0xc,%esp
c010722c:	ff 75 ec             	pushl  -0x14(%ebp)
c010722f:	e8 06 ee ff ff       	call   c010603a <page_ref>
c0107234:	83 c4 10             	add    $0x10,%esp
c0107237:	83 f8 01             	cmp    $0x1,%eax
c010723a:	74 19                	je     c0107255 <check_boot_pgdir+0x1be>
c010723c:	68 a6 a1 10 c0       	push   $0xc010a1a6
c0107241:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0107246:	68 39 02 00 00       	push   $0x239
c010724b:	68 b8 9d 10 c0       	push   $0xc0109db8
c0107250:	e8 d0 91 ff ff       	call   c0100425 <__panic>
    assert(page_insert(boot_pgdir, p, 0x100 + PGSIZE, PTE_W) == 0);
c0107255:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c010725a:	6a 02                	push   $0x2
c010725c:	68 00 11 00 00       	push   $0x1100
c0107261:	ff 75 ec             	pushl  -0x14(%ebp)
c0107264:	50                   	push   %eax
c0107265:	e8 e4 f6 ff ff       	call   c010694e <page_insert>
c010726a:	83 c4 10             	add    $0x10,%esp
c010726d:	85 c0                	test   %eax,%eax
c010726f:	74 19                	je     c010728a <check_boot_pgdir+0x1f3>
c0107271:	68 b8 a1 10 c0       	push   $0xc010a1b8
c0107276:	68 dd 9d 10 c0       	push   $0xc0109ddd
c010727b:	68 3a 02 00 00       	push   $0x23a
c0107280:	68 b8 9d 10 c0       	push   $0xc0109db8
c0107285:	e8 9b 91 ff ff       	call   c0100425 <__panic>
    assert(page_ref(p) == 2);
c010728a:	83 ec 0c             	sub    $0xc,%esp
c010728d:	ff 75 ec             	pushl  -0x14(%ebp)
c0107290:	e8 a5 ed ff ff       	call   c010603a <page_ref>
c0107295:	83 c4 10             	add    $0x10,%esp
c0107298:	83 f8 02             	cmp    $0x2,%eax
c010729b:	74 19                	je     c01072b6 <check_boot_pgdir+0x21f>
c010729d:	68 ef a1 10 c0       	push   $0xc010a1ef
c01072a2:	68 dd 9d 10 c0       	push   $0xc0109ddd
c01072a7:	68 3b 02 00 00       	push   $0x23b
c01072ac:	68 b8 9d 10 c0       	push   $0xc0109db8
c01072b1:	e8 6f 91 ff ff       	call   c0100425 <__panic>

    const char *str = "ucore: Hello world!!";
c01072b6:	c7 45 e8 00 a2 10 c0 	movl   $0xc010a200,-0x18(%ebp)
    strcpy((void *)0x100, str);
c01072bd:	83 ec 08             	sub    $0x8,%esp
c01072c0:	ff 75 e8             	pushl  -0x18(%ebp)
c01072c3:	68 00 01 00 00       	push   $0x100
c01072c8:	e8 11 06 00 00       	call   c01078de <strcpy>
c01072cd:	83 c4 10             	add    $0x10,%esp
    assert(strcmp((void *)0x100, (void *)(0x100 + PGSIZE)) == 0);
c01072d0:	83 ec 08             	sub    $0x8,%esp
c01072d3:	68 00 11 00 00       	push   $0x1100
c01072d8:	68 00 01 00 00       	push   $0x100
c01072dd:	e8 7d 06 00 00       	call   c010795f <strcmp>
c01072e2:	83 c4 10             	add    $0x10,%esp
c01072e5:	85 c0                	test   %eax,%eax
c01072e7:	74 19                	je     c0107302 <check_boot_pgdir+0x26b>
c01072e9:	68 18 a2 10 c0       	push   $0xc010a218
c01072ee:	68 dd 9d 10 c0       	push   $0xc0109ddd
c01072f3:	68 3f 02 00 00       	push   $0x23f
c01072f8:	68 b8 9d 10 c0       	push   $0xc0109db8
c01072fd:	e8 23 91 ff ff       	call   c0100425 <__panic>

    *(char *)(page2kva(p) + 0x100) = '\0';
c0107302:	83 ec 0c             	sub    $0xc,%esp
c0107305:	ff 75 ec             	pushl  -0x14(%ebp)
c0107308:	e8 53 ec ff ff       	call   c0105f60 <page2kva>
c010730d:	83 c4 10             	add    $0x10,%esp
c0107310:	05 00 01 00 00       	add    $0x100,%eax
c0107315:	c6 00 00             	movb   $0x0,(%eax)
    assert(strlen((const char *)0x100) == 0);
c0107318:	83 ec 0c             	sub    $0xc,%esp
c010731b:	68 00 01 00 00       	push   $0x100
c0107320:	e8 59 05 00 00       	call   c010787e <strlen>
c0107325:	83 c4 10             	add    $0x10,%esp
c0107328:	85 c0                	test   %eax,%eax
c010732a:	74 19                	je     c0107345 <check_boot_pgdir+0x2ae>
c010732c:	68 50 a2 10 c0       	push   $0xc010a250
c0107331:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0107336:	68 42 02 00 00       	push   $0x242
c010733b:	68 b8 9d 10 c0       	push   $0xc0109db8
c0107340:	e8 e0 90 ff ff       	call   c0100425 <__panic>

    free_page(p);
c0107345:	83 ec 08             	sub    $0x8,%esp
c0107348:	6a 01                	push   $0x1
c010734a:	ff 75 ec             	pushl  -0x14(%ebp)
c010734d:	e8 69 ef ff ff       	call   c01062bb <free_pages>
c0107352:	83 c4 10             	add    $0x10,%esp
    free_page(pde2page(boot_pgdir[0]));
c0107355:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c010735a:	8b 00                	mov    (%eax),%eax
c010735c:	83 ec 0c             	sub    $0xc,%esp
c010735f:	50                   	push   %eax
c0107360:	e8 b9 ec ff ff       	call   c010601e <pde2page>
c0107365:	83 c4 10             	add    $0x10,%esp
c0107368:	83 ec 08             	sub    $0x8,%esp
c010736b:	6a 01                	push   $0x1
c010736d:	50                   	push   %eax
c010736e:	e8 48 ef ff ff       	call   c01062bb <free_pages>
c0107373:	83 c4 10             	add    $0x10,%esp
    boot_pgdir[0] = 0;
c0107376:	a1 00 2a 12 c0       	mov    0xc0122a00,%eax
c010737b:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    cprintf("check_boot_pgdir() succeeded!\n");
c0107381:	83 ec 0c             	sub    $0xc,%esp
c0107384:	68 74 a2 10 c0       	push   $0xc010a274
c0107389:	e8 1c 8f ff ff       	call   c01002aa <cprintf>
c010738e:	83 c4 10             	add    $0x10,%esp
}
c0107391:	90                   	nop
c0107392:	c9                   	leave  
c0107393:	c3                   	ret    

c0107394 <perm2str>:

//perm2str - use string 'u,r,w,-' to present the permission
static const char *
perm2str(int perm) {
c0107394:	f3 0f 1e fb          	endbr32 
c0107398:	55                   	push   %ebp
c0107399:	89 e5                	mov    %esp,%ebp
    static char str[4];
    str[0] = (perm & PTE_U) ? 'u' : '-';
c010739b:	8b 45 08             	mov    0x8(%ebp),%eax
c010739e:	83 e0 04             	and    $0x4,%eax
c01073a1:	85 c0                	test   %eax,%eax
c01073a3:	74 07                	je     c01073ac <perm2str+0x18>
c01073a5:	b8 75 00 00 00       	mov    $0x75,%eax
c01073aa:	eb 05                	jmp    c01073b1 <perm2str+0x1d>
c01073ac:	b8 2d 00 00 00       	mov    $0x2d,%eax
c01073b1:	a2 08 60 12 c0       	mov    %al,0xc0126008
    str[1] = 'r';
c01073b6:	c6 05 09 60 12 c0 72 	movb   $0x72,0xc0126009
    str[2] = (perm & PTE_W) ? 'w' : '-';
c01073bd:	8b 45 08             	mov    0x8(%ebp),%eax
c01073c0:	83 e0 02             	and    $0x2,%eax
c01073c3:	85 c0                	test   %eax,%eax
c01073c5:	74 07                	je     c01073ce <perm2str+0x3a>
c01073c7:	b8 77 00 00 00       	mov    $0x77,%eax
c01073cc:	eb 05                	jmp    c01073d3 <perm2str+0x3f>
c01073ce:	b8 2d 00 00 00       	mov    $0x2d,%eax
c01073d3:	a2 0a 60 12 c0       	mov    %al,0xc012600a
    str[3] = '\0';
c01073d8:	c6 05 0b 60 12 c0 00 	movb   $0x0,0xc012600b
    return str;
c01073df:	b8 08 60 12 c0       	mov    $0xc0126008,%eax
}
c01073e4:	5d                   	pop    %ebp
c01073e5:	c3                   	ret    

c01073e6 <get_pgtable_items>:
//  table:       the beginning addr of table
//  left_store:  the pointer of the high side of table's next range
//  right_store: the pointer of the low side of table's next range
// return value: 0 - not a invalid item range, perm - a valid item range with perm permission 
static int
get_pgtable_items(size_t left, size_t right, size_t start, uintptr_t *table, size_t *left_store, size_t *right_store) {
c01073e6:	f3 0f 1e fb          	endbr32 
c01073ea:	55                   	push   %ebp
c01073eb:	89 e5                	mov    %esp,%ebp
c01073ed:	83 ec 10             	sub    $0x10,%esp
    if (start >= right) {
c01073f0:	8b 45 10             	mov    0x10(%ebp),%eax
c01073f3:	3b 45 0c             	cmp    0xc(%ebp),%eax
c01073f6:	72 0e                	jb     c0107406 <get_pgtable_items+0x20>
        return 0;
c01073f8:	b8 00 00 00 00       	mov    $0x0,%eax
c01073fd:	e9 9a 00 00 00       	jmp    c010749c <get_pgtable_items+0xb6>
    }
    while (start < right && !(table[start] & PTE_P)) {
        start ++;
c0107402:	83 45 10 01          	addl   $0x1,0x10(%ebp)
    while (start < right && !(table[start] & PTE_P)) {
c0107406:	8b 45 10             	mov    0x10(%ebp),%eax
c0107409:	3b 45 0c             	cmp    0xc(%ebp),%eax
c010740c:	73 18                	jae    c0107426 <get_pgtable_items+0x40>
c010740e:	8b 45 10             	mov    0x10(%ebp),%eax
c0107411:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c0107418:	8b 45 14             	mov    0x14(%ebp),%eax
c010741b:	01 d0                	add    %edx,%eax
c010741d:	8b 00                	mov    (%eax),%eax
c010741f:	83 e0 01             	and    $0x1,%eax
c0107422:	85 c0                	test   %eax,%eax
c0107424:	74 dc                	je     c0107402 <get_pgtable_items+0x1c>
    }
    if (start < right) {
c0107426:	8b 45 10             	mov    0x10(%ebp),%eax
c0107429:	3b 45 0c             	cmp    0xc(%ebp),%eax
c010742c:	73 69                	jae    c0107497 <get_pgtable_items+0xb1>
        if (left_store != NULL) {
c010742e:	83 7d 18 00          	cmpl   $0x0,0x18(%ebp)
c0107432:	74 08                	je     c010743c <get_pgtable_items+0x56>
            *left_store = start;
c0107434:	8b 45 18             	mov    0x18(%ebp),%eax
c0107437:	8b 55 10             	mov    0x10(%ebp),%edx
c010743a:	89 10                	mov    %edx,(%eax)
        }
        int perm = (table[start ++] & PTE_USER);
c010743c:	8b 45 10             	mov    0x10(%ebp),%eax
c010743f:	8d 50 01             	lea    0x1(%eax),%edx
c0107442:	89 55 10             	mov    %edx,0x10(%ebp)
c0107445:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c010744c:	8b 45 14             	mov    0x14(%ebp),%eax
c010744f:	01 d0                	add    %edx,%eax
c0107451:	8b 00                	mov    (%eax),%eax
c0107453:	83 e0 07             	and    $0x7,%eax
c0107456:	89 45 fc             	mov    %eax,-0x4(%ebp)
        while (start < right && (table[start] & PTE_USER) == perm) {
c0107459:	eb 04                	jmp    c010745f <get_pgtable_items+0x79>
            start ++;
c010745b:	83 45 10 01          	addl   $0x1,0x10(%ebp)
        while (start < right && (table[start] & PTE_USER) == perm) {
c010745f:	8b 45 10             	mov    0x10(%ebp),%eax
c0107462:	3b 45 0c             	cmp    0xc(%ebp),%eax
c0107465:	73 1d                	jae    c0107484 <get_pgtable_items+0x9e>
c0107467:	8b 45 10             	mov    0x10(%ebp),%eax
c010746a:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c0107471:	8b 45 14             	mov    0x14(%ebp),%eax
c0107474:	01 d0                	add    %edx,%eax
c0107476:	8b 00                	mov    (%eax),%eax
c0107478:	83 e0 07             	and    $0x7,%eax
c010747b:	89 c2                	mov    %eax,%edx
c010747d:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0107480:	39 c2                	cmp    %eax,%edx
c0107482:	74 d7                	je     c010745b <get_pgtable_items+0x75>
        }
        if (right_store != NULL) {
c0107484:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
c0107488:	74 08                	je     c0107492 <get_pgtable_items+0xac>
            *right_store = start;
c010748a:	8b 45 1c             	mov    0x1c(%ebp),%eax
c010748d:	8b 55 10             	mov    0x10(%ebp),%edx
c0107490:	89 10                	mov    %edx,(%eax)
        }
        return perm;
c0107492:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0107495:	eb 05                	jmp    c010749c <get_pgtable_items+0xb6>
    }
    return 0;
c0107497:	b8 00 00 00 00       	mov    $0x0,%eax
}
c010749c:	c9                   	leave  
c010749d:	c3                   	ret    

c010749e <print_pgdir>:

//print_pgdir - print the PDT&PT
void
print_pgdir(void) {
c010749e:	f3 0f 1e fb          	endbr32 
c01074a2:	55                   	push   %ebp
c01074a3:	89 e5                	mov    %esp,%ebp
c01074a5:	57                   	push   %edi
c01074a6:	56                   	push   %esi
c01074a7:	53                   	push   %ebx
c01074a8:	83 ec 2c             	sub    $0x2c,%esp
    cprintf("-------------------- BEGIN --------------------\n");
c01074ab:	83 ec 0c             	sub    $0xc,%esp
c01074ae:	68 94 a2 10 c0       	push   $0xc010a294
c01074b3:	e8 f2 8d ff ff       	call   c01002aa <cprintf>
c01074b8:	83 c4 10             	add    $0x10,%esp
    size_t left, right = 0, perm;
c01074bb:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
c01074c2:	e9 e1 00 00 00       	jmp    c01075a8 <print_pgdir+0x10a>
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
c01074c7:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01074ca:	83 ec 0c             	sub    $0xc,%esp
c01074cd:	50                   	push   %eax
c01074ce:	e8 c1 fe ff ff       	call   c0107394 <perm2str>
c01074d3:	83 c4 10             	add    $0x10,%esp
                left * PTSIZE, right * PTSIZE, (right - left) * PTSIZE, perm2str(perm));
c01074d6:	8b 4d dc             	mov    -0x24(%ebp),%ecx
c01074d9:	8b 55 e0             	mov    -0x20(%ebp),%edx
c01074dc:	29 d1                	sub    %edx,%ecx
c01074de:	89 ca                	mov    %ecx,%edx
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
c01074e0:	89 d6                	mov    %edx,%esi
c01074e2:	c1 e6 16             	shl    $0x16,%esi
c01074e5:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01074e8:	89 d3                	mov    %edx,%ebx
c01074ea:	c1 e3 16             	shl    $0x16,%ebx
c01074ed:	8b 55 e0             	mov    -0x20(%ebp),%edx
c01074f0:	89 d1                	mov    %edx,%ecx
c01074f2:	c1 e1 16             	shl    $0x16,%ecx
c01074f5:	8b 7d dc             	mov    -0x24(%ebp),%edi
c01074f8:	8b 55 e0             	mov    -0x20(%ebp),%edx
c01074fb:	29 d7                	sub    %edx,%edi
c01074fd:	89 fa                	mov    %edi,%edx
c01074ff:	83 ec 08             	sub    $0x8,%esp
c0107502:	50                   	push   %eax
c0107503:	56                   	push   %esi
c0107504:	53                   	push   %ebx
c0107505:	51                   	push   %ecx
c0107506:	52                   	push   %edx
c0107507:	68 c5 a2 10 c0       	push   $0xc010a2c5
c010750c:	e8 99 8d ff ff       	call   c01002aa <cprintf>
c0107511:	83 c4 20             	add    $0x20,%esp
        size_t l, r = left * NPTEENTRY;
c0107514:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0107517:	c1 e0 0a             	shl    $0xa,%eax
c010751a:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
c010751d:	eb 4d                	jmp    c010756c <print_pgdir+0xce>
            cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
c010751f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0107522:	83 ec 0c             	sub    $0xc,%esp
c0107525:	50                   	push   %eax
c0107526:	e8 69 fe ff ff       	call   c0107394 <perm2str>
c010752b:	83 c4 10             	add    $0x10,%esp
                    l * PGSIZE, r * PGSIZE, (r - l) * PGSIZE, perm2str(perm));
c010752e:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
c0107531:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0107534:	29 d1                	sub    %edx,%ecx
c0107536:	89 ca                	mov    %ecx,%edx
            cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
c0107538:	89 d6                	mov    %edx,%esi
c010753a:	c1 e6 0c             	shl    $0xc,%esi
c010753d:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0107540:	89 d3                	mov    %edx,%ebx
c0107542:	c1 e3 0c             	shl    $0xc,%ebx
c0107545:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0107548:	89 d1                	mov    %edx,%ecx
c010754a:	c1 e1 0c             	shl    $0xc,%ecx
c010754d:	8b 7d d4             	mov    -0x2c(%ebp),%edi
c0107550:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0107553:	29 d7                	sub    %edx,%edi
c0107555:	89 fa                	mov    %edi,%edx
c0107557:	83 ec 08             	sub    $0x8,%esp
c010755a:	50                   	push   %eax
c010755b:	56                   	push   %esi
c010755c:	53                   	push   %ebx
c010755d:	51                   	push   %ecx
c010755e:	52                   	push   %edx
c010755f:	68 e4 a2 10 c0       	push   $0xc010a2e4
c0107564:	e8 41 8d ff ff       	call   c01002aa <cprintf>
c0107569:	83 c4 20             	add    $0x20,%esp
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
c010756c:	be 00 00 c0 fa       	mov    $0xfac00000,%esi
c0107571:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0107574:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0107577:	89 d3                	mov    %edx,%ebx
c0107579:	c1 e3 0a             	shl    $0xa,%ebx
c010757c:	8b 55 e0             	mov    -0x20(%ebp),%edx
c010757f:	89 d1                	mov    %edx,%ecx
c0107581:	c1 e1 0a             	shl    $0xa,%ecx
c0107584:	83 ec 08             	sub    $0x8,%esp
c0107587:	8d 55 d4             	lea    -0x2c(%ebp),%edx
c010758a:	52                   	push   %edx
c010758b:	8d 55 d8             	lea    -0x28(%ebp),%edx
c010758e:	52                   	push   %edx
c010758f:	56                   	push   %esi
c0107590:	50                   	push   %eax
c0107591:	53                   	push   %ebx
c0107592:	51                   	push   %ecx
c0107593:	e8 4e fe ff ff       	call   c01073e6 <get_pgtable_items>
c0107598:	83 c4 20             	add    $0x20,%esp
c010759b:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c010759e:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c01075a2:	0f 85 77 ff ff ff    	jne    c010751f <print_pgdir+0x81>
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
c01075a8:	b9 00 b0 fe fa       	mov    $0xfafeb000,%ecx
c01075ad:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01075b0:	83 ec 08             	sub    $0x8,%esp
c01075b3:	8d 55 dc             	lea    -0x24(%ebp),%edx
c01075b6:	52                   	push   %edx
c01075b7:	8d 55 e0             	lea    -0x20(%ebp),%edx
c01075ba:	52                   	push   %edx
c01075bb:	51                   	push   %ecx
c01075bc:	50                   	push   %eax
c01075bd:	68 00 04 00 00       	push   $0x400
c01075c2:	6a 00                	push   $0x0
c01075c4:	e8 1d fe ff ff       	call   c01073e6 <get_pgtable_items>
c01075c9:	83 c4 20             	add    $0x20,%esp
c01075cc:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c01075cf:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c01075d3:	0f 85 ee fe ff ff    	jne    c01074c7 <print_pgdir+0x29>
        }
    }
    cprintf("--------------------- END ---------------------\n");
c01075d9:	83 ec 0c             	sub    $0xc,%esp
c01075dc:	68 08 a3 10 c0       	push   $0xc010a308
c01075e1:	e8 c4 8c ff ff       	call   c01002aa <cprintf>
c01075e6:	83 c4 10             	add    $0x10,%esp
}
c01075e9:	90                   	nop
c01075ea:	8d 65 f4             	lea    -0xc(%ebp),%esp
c01075ed:	5b                   	pop    %ebx
c01075ee:	5e                   	pop    %esi
c01075ef:	5f                   	pop    %edi
c01075f0:	5d                   	pop    %ebp
c01075f1:	c3                   	ret    

c01075f2 <kmalloc>:

void *
kmalloc(size_t n) {
c01075f2:	f3 0f 1e fb          	endbr32 
c01075f6:	55                   	push   %ebp
c01075f7:	89 e5                	mov    %esp,%ebp
c01075f9:	83 ec 18             	sub    $0x18,%esp
    void * ptr=NULL;
c01075fc:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    struct Page *base=NULL;
c0107603:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    assert(n > 0 && n < 1024*0124);
c010760a:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c010760e:	74 09                	je     c0107619 <kmalloc+0x27>
c0107610:	81 7d 08 ff 4f 01 00 	cmpl   $0x14fff,0x8(%ebp)
c0107617:	76 19                	jbe    c0107632 <kmalloc+0x40>
c0107619:	68 39 a3 10 c0       	push   $0xc010a339
c010761e:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0107623:	68 8e 02 00 00       	push   $0x28e
c0107628:	68 b8 9d 10 c0       	push   $0xc0109db8
c010762d:	e8 f3 8d ff ff       	call   c0100425 <__panic>
    int num_pages=(n+PGSIZE-1)/PGSIZE;
c0107632:	8b 45 08             	mov    0x8(%ebp),%eax
c0107635:	05 ff 0f 00 00       	add    $0xfff,%eax
c010763a:	c1 e8 0c             	shr    $0xc,%eax
c010763d:	89 45 ec             	mov    %eax,-0x14(%ebp)
    base = alloc_pages(num_pages);
c0107640:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0107643:	83 ec 0c             	sub    $0xc,%esp
c0107646:	50                   	push   %eax
c0107647:	e8 ff eb ff ff       	call   c010624b <alloc_pages>
c010764c:	83 c4 10             	add    $0x10,%esp
c010764f:	89 45 f0             	mov    %eax,-0x10(%ebp)
    assert(base != NULL);
c0107652:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0107656:	75 19                	jne    c0107671 <kmalloc+0x7f>
c0107658:	68 50 a3 10 c0       	push   $0xc010a350
c010765d:	68 dd 9d 10 c0       	push   $0xc0109ddd
c0107662:	68 91 02 00 00       	push   $0x291
c0107667:	68 b8 9d 10 c0       	push   $0xc0109db8
c010766c:	e8 b4 8d ff ff       	call   c0100425 <__panic>
    ptr=page2kva(base);
c0107671:	83 ec 0c             	sub    $0xc,%esp
c0107674:	ff 75 f0             	pushl  -0x10(%ebp)
c0107677:	e8 e4 e8 ff ff       	call   c0105f60 <page2kva>
c010767c:	83 c4 10             	add    $0x10,%esp
c010767f:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return ptr;
c0107682:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0107685:	c9                   	leave  
c0107686:	c3                   	ret    

c0107687 <kfree>:

void 
kfree(void *ptr, size_t n) {
c0107687:	f3 0f 1e fb          	endbr32 
c010768b:	55                   	push   %ebp
c010768c:	89 e5                	mov    %esp,%ebp
c010768e:	83 ec 18             	sub    $0x18,%esp
    assert(n > 0 && n < 1024*0124);
c0107691:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0107695:	74 09                	je     c01076a0 <kfree+0x19>
c0107697:	81 7d 0c ff 4f 01 00 	cmpl   $0x14fff,0xc(%ebp)
c010769e:	76 19                	jbe    c01076b9 <kfree+0x32>
c01076a0:	68 39 a3 10 c0       	push   $0xc010a339
c01076a5:	68 dd 9d 10 c0       	push   $0xc0109ddd
c01076aa:	68 98 02 00 00       	push   $0x298
c01076af:	68 b8 9d 10 c0       	push   $0xc0109db8
c01076b4:	e8 6c 8d ff ff       	call   c0100425 <__panic>
    assert(ptr != NULL);
c01076b9:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c01076bd:	75 19                	jne    c01076d8 <kfree+0x51>
c01076bf:	68 5d a3 10 c0       	push   $0xc010a35d
c01076c4:	68 dd 9d 10 c0       	push   $0xc0109ddd
c01076c9:	68 99 02 00 00       	push   $0x299
c01076ce:	68 b8 9d 10 c0       	push   $0xc0109db8
c01076d3:	e8 4d 8d ff ff       	call   c0100425 <__panic>
    struct Page *base=NULL;
c01076d8:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    int num_pages=(n+PGSIZE-1)/PGSIZE;
c01076df:	8b 45 0c             	mov    0xc(%ebp),%eax
c01076e2:	05 ff 0f 00 00       	add    $0xfff,%eax
c01076e7:	c1 e8 0c             	shr    $0xc,%eax
c01076ea:	89 45 f0             	mov    %eax,-0x10(%ebp)
    base = kva2page(ptr);
c01076ed:	83 ec 0c             	sub    $0xc,%esp
c01076f0:	ff 75 08             	pushl  0x8(%ebp)
c01076f3:	e8 ad e8 ff ff       	call   c0105fa5 <kva2page>
c01076f8:	83 c4 10             	add    $0x10,%esp
c01076fb:	89 45 f4             	mov    %eax,-0xc(%ebp)
    free_pages(base, num_pages);
c01076fe:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0107701:	83 ec 08             	sub    $0x8,%esp
c0107704:	50                   	push   %eax
c0107705:	ff 75 f4             	pushl  -0xc(%ebp)
c0107708:	e8 ae eb ff ff       	call   c01062bb <free_pages>
c010770d:	83 c4 10             	add    $0x10,%esp
}
c0107710:	90                   	nop
c0107711:	c9                   	leave  
c0107712:	c3                   	ret    

c0107713 <page2ppn>:
page2ppn(struct Page *page) {
c0107713:	55                   	push   %ebp
c0107714:	89 e5                	mov    %esp,%ebp
    return page - pages;
c0107716:	a1 f8 60 12 c0       	mov    0xc01260f8,%eax
c010771b:	8b 55 08             	mov    0x8(%ebp),%edx
c010771e:	29 c2                	sub    %eax,%edx
c0107720:	89 d0                	mov    %edx,%eax
c0107722:	c1 f8 05             	sar    $0x5,%eax
}
c0107725:	5d                   	pop    %ebp
c0107726:	c3                   	ret    

c0107727 <page2pa>:
page2pa(struct Page *page) {
c0107727:	55                   	push   %ebp
c0107728:	89 e5                	mov    %esp,%ebp
    return page2ppn(page) << PGSHIFT;
c010772a:	ff 75 08             	pushl  0x8(%ebp)
c010772d:	e8 e1 ff ff ff       	call   c0107713 <page2ppn>
c0107732:	83 c4 04             	add    $0x4,%esp
c0107735:	c1 e0 0c             	shl    $0xc,%eax
}
c0107738:	c9                   	leave  
c0107739:	c3                   	ret    

c010773a <page2kva>:
page2kva(struct Page *page) {
c010773a:	55                   	push   %ebp
c010773b:	89 e5                	mov    %esp,%ebp
c010773d:	83 ec 18             	sub    $0x18,%esp
    return KADDR(page2pa(page));
c0107740:	ff 75 08             	pushl  0x8(%ebp)
c0107743:	e8 df ff ff ff       	call   c0107727 <page2pa>
c0107748:	83 c4 04             	add    $0x4,%esp
c010774b:	89 45 f4             	mov    %eax,-0xc(%ebp)
c010774e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0107751:	c1 e8 0c             	shr    $0xc,%eax
c0107754:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0107757:	a1 80 5f 12 c0       	mov    0xc0125f80,%eax
c010775c:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c010775f:	72 14                	jb     c0107775 <page2kva+0x3b>
c0107761:	ff 75 f4             	pushl  -0xc(%ebp)
c0107764:	68 6c a3 10 c0       	push   $0xc010a36c
c0107769:	6a 62                	push   $0x62
c010776b:	68 8f a3 10 c0       	push   $0xc010a38f
c0107770:	e8 b0 8c ff ff       	call   c0100425 <__panic>
c0107775:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0107778:	2d 00 00 00 40       	sub    $0x40000000,%eax
}
c010777d:	c9                   	leave  
c010777e:	c3                   	ret    

c010777f <swapfs_init>:
#include <ide.h>
#include <pmm.h>
#include <assert.h>

void
swapfs_init(void) {
c010777f:	f3 0f 1e fb          	endbr32 
c0107783:	55                   	push   %ebp
c0107784:	89 e5                	mov    %esp,%ebp
c0107786:	83 ec 08             	sub    $0x8,%esp
    static_assert((PGSIZE % SECTSIZE) == 0);
    if (!ide_device_valid(SWAP_DEV_NO)) {
c0107789:	83 ec 0c             	sub    $0xc,%esp
c010778c:	6a 01                	push   $0x1
c010778e:	e8 94 99 ff ff       	call   c0101127 <ide_device_valid>
c0107793:	83 c4 10             	add    $0x10,%esp
c0107796:	85 c0                	test   %eax,%eax
c0107798:	75 14                	jne    c01077ae <swapfs_init+0x2f>
        panic("swap fs isn't available.\n");
c010779a:	83 ec 04             	sub    $0x4,%esp
c010779d:	68 9d a3 10 c0       	push   $0xc010a39d
c01077a2:	6a 0d                	push   $0xd
c01077a4:	68 b7 a3 10 c0       	push   $0xc010a3b7
c01077a9:	e8 77 8c ff ff       	call   c0100425 <__panic>
    }
    max_swap_offset = ide_device_size(SWAP_DEV_NO) / (PGSIZE / SECTSIZE);
c01077ae:	83 ec 0c             	sub    $0xc,%esp
c01077b1:	6a 01                	push   $0x1
c01077b3:	e8 a8 99 ff ff       	call   c0101160 <ide_device_size>
c01077b8:	83 c4 10             	add    $0x10,%esp
c01077bb:	c1 e8 03             	shr    $0x3,%eax
c01077be:	a3 bc 60 12 c0       	mov    %eax,0xc01260bc
}
c01077c3:	90                   	nop
c01077c4:	c9                   	leave  
c01077c5:	c3                   	ret    

c01077c6 <swapfs_read>:

int
swapfs_read(swap_entry_t entry, struct Page *page) {
c01077c6:	f3 0f 1e fb          	endbr32 
c01077ca:	55                   	push   %ebp
c01077cb:	89 e5                	mov    %esp,%ebp
c01077cd:	83 ec 18             	sub    $0x18,%esp
    return ide_read_secs(SWAP_DEV_NO, swap_offset(entry) * PAGE_NSECT, page2kva(page), PAGE_NSECT);
c01077d0:	83 ec 0c             	sub    $0xc,%esp
c01077d3:	ff 75 0c             	pushl  0xc(%ebp)
c01077d6:	e8 5f ff ff ff       	call   c010773a <page2kva>
c01077db:	83 c4 10             	add    $0x10,%esp
c01077de:	8b 55 08             	mov    0x8(%ebp),%edx
c01077e1:	c1 ea 08             	shr    $0x8,%edx
c01077e4:	89 55 f4             	mov    %edx,-0xc(%ebp)
c01077e7:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01077eb:	74 0b                	je     c01077f8 <swapfs_read+0x32>
c01077ed:	8b 15 bc 60 12 c0    	mov    0xc01260bc,%edx
c01077f3:	39 55 f4             	cmp    %edx,-0xc(%ebp)
c01077f6:	72 14                	jb     c010780c <swapfs_read+0x46>
c01077f8:	ff 75 08             	pushl  0x8(%ebp)
c01077fb:	68 c8 a3 10 c0       	push   $0xc010a3c8
c0107800:	6a 14                	push   $0x14
c0107802:	68 b7 a3 10 c0       	push   $0xc010a3b7
c0107807:	e8 19 8c ff ff       	call   c0100425 <__panic>
c010780c:	8b 55 f4             	mov    -0xc(%ebp),%edx
c010780f:	c1 e2 03             	shl    $0x3,%edx
c0107812:	6a 08                	push   $0x8
c0107814:	50                   	push   %eax
c0107815:	52                   	push   %edx
c0107816:	6a 01                	push   $0x1
c0107818:	e8 7c 99 ff ff       	call   c0101199 <ide_read_secs>
c010781d:	83 c4 10             	add    $0x10,%esp
}
c0107820:	c9                   	leave  
c0107821:	c3                   	ret    

c0107822 <swapfs_write>:

int
swapfs_write(swap_entry_t entry, struct Page *page) {
c0107822:	f3 0f 1e fb          	endbr32 
c0107826:	55                   	push   %ebp
c0107827:	89 e5                	mov    %esp,%ebp
c0107829:	83 ec 18             	sub    $0x18,%esp
    return ide_write_secs(SWAP_DEV_NO, swap_offset(entry) * PAGE_NSECT, page2kva(page), PAGE_NSECT);
c010782c:	83 ec 0c             	sub    $0xc,%esp
c010782f:	ff 75 0c             	pushl  0xc(%ebp)
c0107832:	e8 03 ff ff ff       	call   c010773a <page2kva>
c0107837:	83 c4 10             	add    $0x10,%esp
c010783a:	8b 55 08             	mov    0x8(%ebp),%edx
c010783d:	c1 ea 08             	shr    $0x8,%edx
c0107840:	89 55 f4             	mov    %edx,-0xc(%ebp)
c0107843:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0107847:	74 0b                	je     c0107854 <swapfs_write+0x32>
c0107849:	8b 15 bc 60 12 c0    	mov    0xc01260bc,%edx
c010784f:	39 55 f4             	cmp    %edx,-0xc(%ebp)
c0107852:	72 14                	jb     c0107868 <swapfs_write+0x46>
c0107854:	ff 75 08             	pushl  0x8(%ebp)
c0107857:	68 c8 a3 10 c0       	push   $0xc010a3c8
c010785c:	6a 19                	push   $0x19
c010785e:	68 b7 a3 10 c0       	push   $0xc010a3b7
c0107863:	e8 bd 8b ff ff       	call   c0100425 <__panic>
c0107868:	8b 55 f4             	mov    -0xc(%ebp),%edx
c010786b:	c1 e2 03             	shl    $0x3,%edx
c010786e:	6a 08                	push   $0x8
c0107870:	50                   	push   %eax
c0107871:	52                   	push   %edx
c0107872:	6a 01                	push   $0x1
c0107874:	e8 4b 9b ff ff       	call   c01013c4 <ide_write_secs>
c0107879:	83 c4 10             	add    $0x10,%esp
}
c010787c:	c9                   	leave  
c010787d:	c3                   	ret    

c010787e <strlen>:
 * @s:      the input string
 *
 * The strlen() function returns the length of string @s.
 * */
size_t
strlen(const char *s) {
c010787e:	f3 0f 1e fb          	endbr32 
c0107882:	55                   	push   %ebp
c0107883:	89 e5                	mov    %esp,%ebp
c0107885:	83 ec 10             	sub    $0x10,%esp
    size_t cnt = 0;
c0107888:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while (*s ++ != '\0') {
c010788f:	eb 04                	jmp    c0107895 <strlen+0x17>
        cnt ++;
c0107891:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
    while (*s ++ != '\0') {
c0107895:	8b 45 08             	mov    0x8(%ebp),%eax
c0107898:	8d 50 01             	lea    0x1(%eax),%edx
c010789b:	89 55 08             	mov    %edx,0x8(%ebp)
c010789e:	0f b6 00             	movzbl (%eax),%eax
c01078a1:	84 c0                	test   %al,%al
c01078a3:	75 ec                	jne    c0107891 <strlen+0x13>
    }
    return cnt;
c01078a5:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c01078a8:	c9                   	leave  
c01078a9:	c3                   	ret    

c01078aa <strnlen>:
 * The return value is strlen(s), if that is less than @len, or
 * @len if there is no '\0' character among the first @len characters
 * pointed by @s.
 * */
size_t
strnlen(const char *s, size_t len) {
c01078aa:	f3 0f 1e fb          	endbr32 
c01078ae:	55                   	push   %ebp
c01078af:	89 e5                	mov    %esp,%ebp
c01078b1:	83 ec 10             	sub    $0x10,%esp
    size_t cnt = 0;
c01078b4:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while (cnt < len && *s ++ != '\0') {
c01078bb:	eb 04                	jmp    c01078c1 <strnlen+0x17>
        cnt ++;
c01078bd:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
    while (cnt < len && *s ++ != '\0') {
c01078c1:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01078c4:	3b 45 0c             	cmp    0xc(%ebp),%eax
c01078c7:	73 10                	jae    c01078d9 <strnlen+0x2f>
c01078c9:	8b 45 08             	mov    0x8(%ebp),%eax
c01078cc:	8d 50 01             	lea    0x1(%eax),%edx
c01078cf:	89 55 08             	mov    %edx,0x8(%ebp)
c01078d2:	0f b6 00             	movzbl (%eax),%eax
c01078d5:	84 c0                	test   %al,%al
c01078d7:	75 e4                	jne    c01078bd <strnlen+0x13>
    }
    return cnt;
c01078d9:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c01078dc:	c9                   	leave  
c01078dd:	c3                   	ret    

c01078de <strcpy>:
 * To avoid overflows, the size of array pointed by @dst should be long enough to
 * contain the same string as @src (including the terminating null character), and
 * should not overlap in memory with @src.
 * */
char *
strcpy(char *dst, const char *src) {
c01078de:	f3 0f 1e fb          	endbr32 
c01078e2:	55                   	push   %ebp
c01078e3:	89 e5                	mov    %esp,%ebp
c01078e5:	57                   	push   %edi
c01078e6:	56                   	push   %esi
c01078e7:	83 ec 20             	sub    $0x20,%esp
c01078ea:	8b 45 08             	mov    0x8(%ebp),%eax
c01078ed:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01078f0:	8b 45 0c             	mov    0xc(%ebp),%eax
c01078f3:	89 45 f0             	mov    %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_STRCPY
#define __HAVE_ARCH_STRCPY
static inline char *
__strcpy(char *dst, const char *src) {
    int d0, d1, d2;
    asm volatile (
c01078f6:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01078f9:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01078fc:	89 d1                	mov    %edx,%ecx
c01078fe:	89 c2                	mov    %eax,%edx
c0107900:	89 ce                	mov    %ecx,%esi
c0107902:	89 d7                	mov    %edx,%edi
c0107904:	ac                   	lods   %ds:(%esi),%al
c0107905:	aa                   	stos   %al,%es:(%edi)
c0107906:	84 c0                	test   %al,%al
c0107908:	75 fa                	jne    c0107904 <strcpy+0x26>
c010790a:	89 fa                	mov    %edi,%edx
c010790c:	89 f1                	mov    %esi,%ecx
c010790e:	89 4d ec             	mov    %ecx,-0x14(%ebp)
c0107911:	89 55 e8             	mov    %edx,-0x18(%ebp)
c0107914:	89 45 e4             	mov    %eax,-0x1c(%ebp)
        "stosb;"
        "testb %%al, %%al;"
        "jne 1b;"
        : "=&S" (d0), "=&D" (d1), "=&a" (d2)
        : "0" (src), "1" (dst) : "memory");
    return dst;
c0107917:	8b 45 f4             	mov    -0xc(%ebp),%eax
    char *p = dst;
    while ((*p ++ = *src ++) != '\0')
        /* nothing */;
    return dst;
#endif /* __HAVE_ARCH_STRCPY */
}
c010791a:	83 c4 20             	add    $0x20,%esp
c010791d:	5e                   	pop    %esi
c010791e:	5f                   	pop    %edi
c010791f:	5d                   	pop    %ebp
c0107920:	c3                   	ret    

c0107921 <strncpy>:
 * @len:    maximum number of characters to be copied from @src
 *
 * The return value is @dst
 * */
char *
strncpy(char *dst, const char *src, size_t len) {
c0107921:	f3 0f 1e fb          	endbr32 
c0107925:	55                   	push   %ebp
c0107926:	89 e5                	mov    %esp,%ebp
c0107928:	83 ec 10             	sub    $0x10,%esp
    char *p = dst;
c010792b:	8b 45 08             	mov    0x8(%ebp),%eax
c010792e:	89 45 fc             	mov    %eax,-0x4(%ebp)
    while (len > 0) {
c0107931:	eb 21                	jmp    c0107954 <strncpy+0x33>
        if ((*p = *src) != '\0') {
c0107933:	8b 45 0c             	mov    0xc(%ebp),%eax
c0107936:	0f b6 10             	movzbl (%eax),%edx
c0107939:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010793c:	88 10                	mov    %dl,(%eax)
c010793e:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0107941:	0f b6 00             	movzbl (%eax),%eax
c0107944:	84 c0                	test   %al,%al
c0107946:	74 04                	je     c010794c <strncpy+0x2b>
            src ++;
c0107948:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
        }
        p ++, len --;
c010794c:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
c0107950:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
    while (len > 0) {
c0107954:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0107958:	75 d9                	jne    c0107933 <strncpy+0x12>
    }
    return dst;
c010795a:	8b 45 08             	mov    0x8(%ebp),%eax
}
c010795d:	c9                   	leave  
c010795e:	c3                   	ret    

c010795f <strcmp>:
 * - A value greater than zero indicates that the first character that does
 *   not match has a greater value in @s1 than in @s2;
 * - And a value less than zero indicates the opposite.
 * */
int
strcmp(const char *s1, const char *s2) {
c010795f:	f3 0f 1e fb          	endbr32 
c0107963:	55                   	push   %ebp
c0107964:	89 e5                	mov    %esp,%ebp
c0107966:	57                   	push   %edi
c0107967:	56                   	push   %esi
c0107968:	83 ec 20             	sub    $0x20,%esp
c010796b:	8b 45 08             	mov    0x8(%ebp),%eax
c010796e:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0107971:	8b 45 0c             	mov    0xc(%ebp),%eax
c0107974:	89 45 f0             	mov    %eax,-0x10(%ebp)
    asm volatile (
c0107977:	8b 55 f4             	mov    -0xc(%ebp),%edx
c010797a:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010797d:	89 d1                	mov    %edx,%ecx
c010797f:	89 c2                	mov    %eax,%edx
c0107981:	89 ce                	mov    %ecx,%esi
c0107983:	89 d7                	mov    %edx,%edi
c0107985:	ac                   	lods   %ds:(%esi),%al
c0107986:	ae                   	scas   %es:(%edi),%al
c0107987:	75 08                	jne    c0107991 <strcmp+0x32>
c0107989:	84 c0                	test   %al,%al
c010798b:	75 f8                	jne    c0107985 <strcmp+0x26>
c010798d:	31 c0                	xor    %eax,%eax
c010798f:	eb 04                	jmp    c0107995 <strcmp+0x36>
c0107991:	19 c0                	sbb    %eax,%eax
c0107993:	0c 01                	or     $0x1,%al
c0107995:	89 fa                	mov    %edi,%edx
c0107997:	89 f1                	mov    %esi,%ecx
c0107999:	89 45 ec             	mov    %eax,-0x14(%ebp)
c010799c:	89 4d e8             	mov    %ecx,-0x18(%ebp)
c010799f:	89 55 e4             	mov    %edx,-0x1c(%ebp)
    return ret;
c01079a2:	8b 45 ec             	mov    -0x14(%ebp),%eax
    while (*s1 != '\0' && *s1 == *s2) {
        s1 ++, s2 ++;
    }
    return (int)((unsigned char)*s1 - (unsigned char)*s2);
#endif /* __HAVE_ARCH_STRCMP */
}
c01079a5:	83 c4 20             	add    $0x20,%esp
c01079a8:	5e                   	pop    %esi
c01079a9:	5f                   	pop    %edi
c01079aa:	5d                   	pop    %ebp
c01079ab:	c3                   	ret    

c01079ac <strncmp>:
 * they are equal to each other, it continues with the following pairs until
 * the characters differ, until a terminating null-character is reached, or
 * until @n characters match in both strings, whichever happens first.
 * */
int
strncmp(const char *s1, const char *s2, size_t n) {
c01079ac:	f3 0f 1e fb          	endbr32 
c01079b0:	55                   	push   %ebp
c01079b1:	89 e5                	mov    %esp,%ebp
    while (n > 0 && *s1 != '\0' && *s1 == *s2) {
c01079b3:	eb 0c                	jmp    c01079c1 <strncmp+0x15>
        n --, s1 ++, s2 ++;
c01079b5:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
c01079b9:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c01079bd:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
    while (n > 0 && *s1 != '\0' && *s1 == *s2) {
c01079c1:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c01079c5:	74 1a                	je     c01079e1 <strncmp+0x35>
c01079c7:	8b 45 08             	mov    0x8(%ebp),%eax
c01079ca:	0f b6 00             	movzbl (%eax),%eax
c01079cd:	84 c0                	test   %al,%al
c01079cf:	74 10                	je     c01079e1 <strncmp+0x35>
c01079d1:	8b 45 08             	mov    0x8(%ebp),%eax
c01079d4:	0f b6 10             	movzbl (%eax),%edx
c01079d7:	8b 45 0c             	mov    0xc(%ebp),%eax
c01079da:	0f b6 00             	movzbl (%eax),%eax
c01079dd:	38 c2                	cmp    %al,%dl
c01079df:	74 d4                	je     c01079b5 <strncmp+0x9>
    }
    return (n == 0) ? 0 : (int)((unsigned char)*s1 - (unsigned char)*s2);
c01079e1:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c01079e5:	74 18                	je     c01079ff <strncmp+0x53>
c01079e7:	8b 45 08             	mov    0x8(%ebp),%eax
c01079ea:	0f b6 00             	movzbl (%eax),%eax
c01079ed:	0f b6 d0             	movzbl %al,%edx
c01079f0:	8b 45 0c             	mov    0xc(%ebp),%eax
c01079f3:	0f b6 00             	movzbl (%eax),%eax
c01079f6:	0f b6 c0             	movzbl %al,%eax
c01079f9:	29 c2                	sub    %eax,%edx
c01079fb:	89 d0                	mov    %edx,%eax
c01079fd:	eb 05                	jmp    c0107a04 <strncmp+0x58>
c01079ff:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0107a04:	5d                   	pop    %ebp
c0107a05:	c3                   	ret    

c0107a06 <strchr>:
 *
 * The strchr() function returns a pointer to the first occurrence of
 * character in @s. If the value is not found, the function returns 'NULL'.
 * */
char *
strchr(const char *s, char c) {
c0107a06:	f3 0f 1e fb          	endbr32 
c0107a0a:	55                   	push   %ebp
c0107a0b:	89 e5                	mov    %esp,%ebp
c0107a0d:	83 ec 04             	sub    $0x4,%esp
c0107a10:	8b 45 0c             	mov    0xc(%ebp),%eax
c0107a13:	88 45 fc             	mov    %al,-0x4(%ebp)
    while (*s != '\0') {
c0107a16:	eb 14                	jmp    c0107a2c <strchr+0x26>
        if (*s == c) {
c0107a18:	8b 45 08             	mov    0x8(%ebp),%eax
c0107a1b:	0f b6 00             	movzbl (%eax),%eax
c0107a1e:	38 45 fc             	cmp    %al,-0x4(%ebp)
c0107a21:	75 05                	jne    c0107a28 <strchr+0x22>
            return (char *)s;
c0107a23:	8b 45 08             	mov    0x8(%ebp),%eax
c0107a26:	eb 13                	jmp    c0107a3b <strchr+0x35>
        }
        s ++;
c0107a28:	83 45 08 01          	addl   $0x1,0x8(%ebp)
    while (*s != '\0') {
c0107a2c:	8b 45 08             	mov    0x8(%ebp),%eax
c0107a2f:	0f b6 00             	movzbl (%eax),%eax
c0107a32:	84 c0                	test   %al,%al
c0107a34:	75 e2                	jne    c0107a18 <strchr+0x12>
    }
    return NULL;
c0107a36:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0107a3b:	c9                   	leave  
c0107a3c:	c3                   	ret    

c0107a3d <strfind>:
 * The strfind() function is like strchr() except that if @c is
 * not found in @s, then it returns a pointer to the null byte at the
 * end of @s, rather than 'NULL'.
 * */
char *
strfind(const char *s, char c) {
c0107a3d:	f3 0f 1e fb          	endbr32 
c0107a41:	55                   	push   %ebp
c0107a42:	89 e5                	mov    %esp,%ebp
c0107a44:	83 ec 04             	sub    $0x4,%esp
c0107a47:	8b 45 0c             	mov    0xc(%ebp),%eax
c0107a4a:	88 45 fc             	mov    %al,-0x4(%ebp)
    while (*s != '\0') {
c0107a4d:	eb 0f                	jmp    c0107a5e <strfind+0x21>
        if (*s == c) {
c0107a4f:	8b 45 08             	mov    0x8(%ebp),%eax
c0107a52:	0f b6 00             	movzbl (%eax),%eax
c0107a55:	38 45 fc             	cmp    %al,-0x4(%ebp)
c0107a58:	74 10                	je     c0107a6a <strfind+0x2d>
            break;
        }
        s ++;
c0107a5a:	83 45 08 01          	addl   $0x1,0x8(%ebp)
    while (*s != '\0') {
c0107a5e:	8b 45 08             	mov    0x8(%ebp),%eax
c0107a61:	0f b6 00             	movzbl (%eax),%eax
c0107a64:	84 c0                	test   %al,%al
c0107a66:	75 e7                	jne    c0107a4f <strfind+0x12>
c0107a68:	eb 01                	jmp    c0107a6b <strfind+0x2e>
            break;
c0107a6a:	90                   	nop
    }
    return (char *)s;
c0107a6b:	8b 45 08             	mov    0x8(%ebp),%eax
}
c0107a6e:	c9                   	leave  
c0107a6f:	c3                   	ret    

c0107a70 <strtol>:
 * an optional "0x" or "0X" prefix.
 *
 * The strtol() function returns the converted integral number as a long int value.
 * */
long
strtol(const char *s, char **endptr, int base) {
c0107a70:	f3 0f 1e fb          	endbr32 
c0107a74:	55                   	push   %ebp
c0107a75:	89 e5                	mov    %esp,%ebp
c0107a77:	83 ec 10             	sub    $0x10,%esp
    int neg = 0;
c0107a7a:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    long val = 0;
c0107a81:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)

    // gobble initial whitespace
    while (*s == ' ' || *s == '\t') {
c0107a88:	eb 04                	jmp    c0107a8e <strtol+0x1e>
        s ++;
c0107a8a:	83 45 08 01          	addl   $0x1,0x8(%ebp)
    while (*s == ' ' || *s == '\t') {
c0107a8e:	8b 45 08             	mov    0x8(%ebp),%eax
c0107a91:	0f b6 00             	movzbl (%eax),%eax
c0107a94:	3c 20                	cmp    $0x20,%al
c0107a96:	74 f2                	je     c0107a8a <strtol+0x1a>
c0107a98:	8b 45 08             	mov    0x8(%ebp),%eax
c0107a9b:	0f b6 00             	movzbl (%eax),%eax
c0107a9e:	3c 09                	cmp    $0x9,%al
c0107aa0:	74 e8                	je     c0107a8a <strtol+0x1a>
    }

    // plus/minus sign
    if (*s == '+') {
c0107aa2:	8b 45 08             	mov    0x8(%ebp),%eax
c0107aa5:	0f b6 00             	movzbl (%eax),%eax
c0107aa8:	3c 2b                	cmp    $0x2b,%al
c0107aaa:	75 06                	jne    c0107ab2 <strtol+0x42>
        s ++;
c0107aac:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c0107ab0:	eb 15                	jmp    c0107ac7 <strtol+0x57>
    }
    else if (*s == '-') {
c0107ab2:	8b 45 08             	mov    0x8(%ebp),%eax
c0107ab5:	0f b6 00             	movzbl (%eax),%eax
c0107ab8:	3c 2d                	cmp    $0x2d,%al
c0107aba:	75 0b                	jne    c0107ac7 <strtol+0x57>
        s ++, neg = 1;
c0107abc:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c0107ac0:	c7 45 fc 01 00 00 00 	movl   $0x1,-0x4(%ebp)
    }

    // hex or octal base prefix
    if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x')) {
c0107ac7:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0107acb:	74 06                	je     c0107ad3 <strtol+0x63>
c0107acd:	83 7d 10 10          	cmpl   $0x10,0x10(%ebp)
c0107ad1:	75 24                	jne    c0107af7 <strtol+0x87>
c0107ad3:	8b 45 08             	mov    0x8(%ebp),%eax
c0107ad6:	0f b6 00             	movzbl (%eax),%eax
c0107ad9:	3c 30                	cmp    $0x30,%al
c0107adb:	75 1a                	jne    c0107af7 <strtol+0x87>
c0107add:	8b 45 08             	mov    0x8(%ebp),%eax
c0107ae0:	83 c0 01             	add    $0x1,%eax
c0107ae3:	0f b6 00             	movzbl (%eax),%eax
c0107ae6:	3c 78                	cmp    $0x78,%al
c0107ae8:	75 0d                	jne    c0107af7 <strtol+0x87>
        s += 2, base = 16;
c0107aea:	83 45 08 02          	addl   $0x2,0x8(%ebp)
c0107aee:	c7 45 10 10 00 00 00 	movl   $0x10,0x10(%ebp)
c0107af5:	eb 2a                	jmp    c0107b21 <strtol+0xb1>
    }
    else if (base == 0 && s[0] == '0') {
c0107af7:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0107afb:	75 17                	jne    c0107b14 <strtol+0xa4>
c0107afd:	8b 45 08             	mov    0x8(%ebp),%eax
c0107b00:	0f b6 00             	movzbl (%eax),%eax
c0107b03:	3c 30                	cmp    $0x30,%al
c0107b05:	75 0d                	jne    c0107b14 <strtol+0xa4>
        s ++, base = 8;
c0107b07:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c0107b0b:	c7 45 10 08 00 00 00 	movl   $0x8,0x10(%ebp)
c0107b12:	eb 0d                	jmp    c0107b21 <strtol+0xb1>
    }
    else if (base == 0) {
c0107b14:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0107b18:	75 07                	jne    c0107b21 <strtol+0xb1>
        base = 10;
c0107b1a:	c7 45 10 0a 00 00 00 	movl   $0xa,0x10(%ebp)

    // digits
    while (1) {
        int dig;

        if (*s >= '0' && *s <= '9') {
c0107b21:	8b 45 08             	mov    0x8(%ebp),%eax
c0107b24:	0f b6 00             	movzbl (%eax),%eax
c0107b27:	3c 2f                	cmp    $0x2f,%al
c0107b29:	7e 1b                	jle    c0107b46 <strtol+0xd6>
c0107b2b:	8b 45 08             	mov    0x8(%ebp),%eax
c0107b2e:	0f b6 00             	movzbl (%eax),%eax
c0107b31:	3c 39                	cmp    $0x39,%al
c0107b33:	7f 11                	jg     c0107b46 <strtol+0xd6>
            dig = *s - '0';
c0107b35:	8b 45 08             	mov    0x8(%ebp),%eax
c0107b38:	0f b6 00             	movzbl (%eax),%eax
c0107b3b:	0f be c0             	movsbl %al,%eax
c0107b3e:	83 e8 30             	sub    $0x30,%eax
c0107b41:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0107b44:	eb 48                	jmp    c0107b8e <strtol+0x11e>
        }
        else if (*s >= 'a' && *s <= 'z') {
c0107b46:	8b 45 08             	mov    0x8(%ebp),%eax
c0107b49:	0f b6 00             	movzbl (%eax),%eax
c0107b4c:	3c 60                	cmp    $0x60,%al
c0107b4e:	7e 1b                	jle    c0107b6b <strtol+0xfb>
c0107b50:	8b 45 08             	mov    0x8(%ebp),%eax
c0107b53:	0f b6 00             	movzbl (%eax),%eax
c0107b56:	3c 7a                	cmp    $0x7a,%al
c0107b58:	7f 11                	jg     c0107b6b <strtol+0xfb>
            dig = *s - 'a' + 10;
c0107b5a:	8b 45 08             	mov    0x8(%ebp),%eax
c0107b5d:	0f b6 00             	movzbl (%eax),%eax
c0107b60:	0f be c0             	movsbl %al,%eax
c0107b63:	83 e8 57             	sub    $0x57,%eax
c0107b66:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0107b69:	eb 23                	jmp    c0107b8e <strtol+0x11e>
        }
        else if (*s >= 'A' && *s <= 'Z') {
c0107b6b:	8b 45 08             	mov    0x8(%ebp),%eax
c0107b6e:	0f b6 00             	movzbl (%eax),%eax
c0107b71:	3c 40                	cmp    $0x40,%al
c0107b73:	7e 3c                	jle    c0107bb1 <strtol+0x141>
c0107b75:	8b 45 08             	mov    0x8(%ebp),%eax
c0107b78:	0f b6 00             	movzbl (%eax),%eax
c0107b7b:	3c 5a                	cmp    $0x5a,%al
c0107b7d:	7f 32                	jg     c0107bb1 <strtol+0x141>
            dig = *s - 'A' + 10;
c0107b7f:	8b 45 08             	mov    0x8(%ebp),%eax
c0107b82:	0f b6 00             	movzbl (%eax),%eax
c0107b85:	0f be c0             	movsbl %al,%eax
c0107b88:	83 e8 37             	sub    $0x37,%eax
c0107b8b:	89 45 f4             	mov    %eax,-0xc(%ebp)
        }
        else {
            break;
        }
        if (dig >= base) {
c0107b8e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0107b91:	3b 45 10             	cmp    0x10(%ebp),%eax
c0107b94:	7d 1a                	jge    c0107bb0 <strtol+0x140>
            break;
        }
        s ++, val = (val * base) + dig;
c0107b96:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c0107b9a:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0107b9d:	0f af 45 10          	imul   0x10(%ebp),%eax
c0107ba1:	89 c2                	mov    %eax,%edx
c0107ba3:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0107ba6:	01 d0                	add    %edx,%eax
c0107ba8:	89 45 f8             	mov    %eax,-0x8(%ebp)
    while (1) {
c0107bab:	e9 71 ff ff ff       	jmp    c0107b21 <strtol+0xb1>
            break;
c0107bb0:	90                   	nop
        // we don't properly detect overflow!
    }

    if (endptr) {
c0107bb1:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0107bb5:	74 08                	je     c0107bbf <strtol+0x14f>
        *endptr = (char *) s;
c0107bb7:	8b 45 0c             	mov    0xc(%ebp),%eax
c0107bba:	8b 55 08             	mov    0x8(%ebp),%edx
c0107bbd:	89 10                	mov    %edx,(%eax)
    }
    return (neg ? -val : val);
c0107bbf:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
c0107bc3:	74 07                	je     c0107bcc <strtol+0x15c>
c0107bc5:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0107bc8:	f7 d8                	neg    %eax
c0107bca:	eb 03                	jmp    c0107bcf <strtol+0x15f>
c0107bcc:	8b 45 f8             	mov    -0x8(%ebp),%eax
}
c0107bcf:	c9                   	leave  
c0107bd0:	c3                   	ret    

c0107bd1 <memset>:
 * @n:      number of bytes to be set to the value
 *
 * The memset() function returns @s.
 * */
void *
memset(void *s, char c, size_t n) {
c0107bd1:	f3 0f 1e fb          	endbr32 
c0107bd5:	55                   	push   %ebp
c0107bd6:	89 e5                	mov    %esp,%ebp
c0107bd8:	57                   	push   %edi
c0107bd9:	83 ec 24             	sub    $0x24,%esp
c0107bdc:	8b 45 0c             	mov    0xc(%ebp),%eax
c0107bdf:	88 45 d8             	mov    %al,-0x28(%ebp)
#ifdef __HAVE_ARCH_MEMSET
    return __memset(s, c, n);
c0107be2:	0f be 45 d8          	movsbl -0x28(%ebp),%eax
c0107be6:	8b 55 08             	mov    0x8(%ebp),%edx
c0107be9:	89 55 f8             	mov    %edx,-0x8(%ebp)
c0107bec:	88 45 f7             	mov    %al,-0x9(%ebp)
c0107bef:	8b 45 10             	mov    0x10(%ebp),%eax
c0107bf2:	89 45 f0             	mov    %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_MEMSET
#define __HAVE_ARCH_MEMSET
static inline void *
__memset(void *s, char c, size_t n) {
    int d0, d1;
    asm volatile (
c0107bf5:	8b 4d f0             	mov    -0x10(%ebp),%ecx
c0107bf8:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
c0107bfc:	8b 55 f8             	mov    -0x8(%ebp),%edx
c0107bff:	89 d7                	mov    %edx,%edi
c0107c01:	f3 aa                	rep stos %al,%es:(%edi)
c0107c03:	89 fa                	mov    %edi,%edx
c0107c05:	89 4d ec             	mov    %ecx,-0x14(%ebp)
c0107c08:	89 55 e8             	mov    %edx,-0x18(%ebp)
        "rep; stosb;"
        : "=&c" (d0), "=&D" (d1)
        : "0" (n), "a" (c), "1" (s)
        : "memory");
    return s;
c0107c0b:	8b 45 f8             	mov    -0x8(%ebp),%eax
    while (n -- > 0) {
        *p ++ = c;
    }
    return s;
#endif /* __HAVE_ARCH_MEMSET */
}
c0107c0e:	83 c4 24             	add    $0x24,%esp
c0107c11:	5f                   	pop    %edi
c0107c12:	5d                   	pop    %ebp
c0107c13:	c3                   	ret    

c0107c14 <memmove>:
 * @n:      number of bytes to copy
 *
 * The memmove() function returns @dst.
 * */
void *
memmove(void *dst, const void *src, size_t n) {
c0107c14:	f3 0f 1e fb          	endbr32 
c0107c18:	55                   	push   %ebp
c0107c19:	89 e5                	mov    %esp,%ebp
c0107c1b:	57                   	push   %edi
c0107c1c:	56                   	push   %esi
c0107c1d:	53                   	push   %ebx
c0107c1e:	83 ec 30             	sub    $0x30,%esp
c0107c21:	8b 45 08             	mov    0x8(%ebp),%eax
c0107c24:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0107c27:	8b 45 0c             	mov    0xc(%ebp),%eax
c0107c2a:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0107c2d:	8b 45 10             	mov    0x10(%ebp),%eax
c0107c30:	89 45 e8             	mov    %eax,-0x18(%ebp)

#ifndef __HAVE_ARCH_MEMMOVE
#define __HAVE_ARCH_MEMMOVE
static inline void *
__memmove(void *dst, const void *src, size_t n) {
    if (dst < src) {
c0107c33:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0107c36:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c0107c39:	73 42                	jae    c0107c7d <memmove+0x69>
c0107c3b:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0107c3e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0107c41:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0107c44:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0107c47:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0107c4a:	89 45 dc             	mov    %eax,-0x24(%ebp)
        "andl $3, %%ecx;"
        "jz 1f;"
        "rep; movsb;"
        "1:"
        : "=&c" (d0), "=&D" (d1), "=&S" (d2)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
c0107c4d:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0107c50:	c1 e8 02             	shr    $0x2,%eax
c0107c53:	89 c1                	mov    %eax,%ecx
    asm volatile (
c0107c55:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0107c58:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0107c5b:	89 d7                	mov    %edx,%edi
c0107c5d:	89 c6                	mov    %eax,%esi
c0107c5f:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
c0107c61:	8b 4d dc             	mov    -0x24(%ebp),%ecx
c0107c64:	83 e1 03             	and    $0x3,%ecx
c0107c67:	74 02                	je     c0107c6b <memmove+0x57>
c0107c69:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
c0107c6b:	89 f0                	mov    %esi,%eax
c0107c6d:	89 fa                	mov    %edi,%edx
c0107c6f:	89 4d d8             	mov    %ecx,-0x28(%ebp)
c0107c72:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c0107c75:	89 45 d0             	mov    %eax,-0x30(%ebp)
        : "memory");
    return dst;
c0107c78:	8b 45 e4             	mov    -0x1c(%ebp),%eax
        return __memcpy(dst, src, n);
c0107c7b:	eb 36                	jmp    c0107cb3 <memmove+0x9f>
        : "0" (n), "1" (n - 1 + src), "2" (n - 1 + dst)
c0107c7d:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0107c80:	8d 50 ff             	lea    -0x1(%eax),%edx
c0107c83:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0107c86:	01 c2                	add    %eax,%edx
c0107c88:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0107c8b:	8d 48 ff             	lea    -0x1(%eax),%ecx
c0107c8e:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0107c91:	8d 1c 01             	lea    (%ecx,%eax,1),%ebx
    asm volatile (
c0107c94:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0107c97:	89 c1                	mov    %eax,%ecx
c0107c99:	89 d8                	mov    %ebx,%eax
c0107c9b:	89 d6                	mov    %edx,%esi
c0107c9d:	89 c7                	mov    %eax,%edi
c0107c9f:	fd                   	std    
c0107ca0:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
c0107ca2:	fc                   	cld    
c0107ca3:	89 f8                	mov    %edi,%eax
c0107ca5:	89 f2                	mov    %esi,%edx
c0107ca7:	89 4d cc             	mov    %ecx,-0x34(%ebp)
c0107caa:	89 55 c8             	mov    %edx,-0x38(%ebp)
c0107cad:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    return dst;
c0107cb0:	8b 45 f0             	mov    -0x10(%ebp),%eax
            *d ++ = *s ++;
        }
    }
    return dst;
#endif /* __HAVE_ARCH_MEMMOVE */
}
c0107cb3:	83 c4 30             	add    $0x30,%esp
c0107cb6:	5b                   	pop    %ebx
c0107cb7:	5e                   	pop    %esi
c0107cb8:	5f                   	pop    %edi
c0107cb9:	5d                   	pop    %ebp
c0107cba:	c3                   	ret    

c0107cbb <memcpy>:
 * it always copies exactly @n bytes. To avoid overflows, the size of arrays pointed
 * by both @src and @dst, should be at least @n bytes, and should not overlap
 * (for overlapping memory area, memmove is a safer approach).
 * */
void *
memcpy(void *dst, const void *src, size_t n) {
c0107cbb:	f3 0f 1e fb          	endbr32 
c0107cbf:	55                   	push   %ebp
c0107cc0:	89 e5                	mov    %esp,%ebp
c0107cc2:	57                   	push   %edi
c0107cc3:	56                   	push   %esi
c0107cc4:	83 ec 20             	sub    $0x20,%esp
c0107cc7:	8b 45 08             	mov    0x8(%ebp),%eax
c0107cca:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0107ccd:	8b 45 0c             	mov    0xc(%ebp),%eax
c0107cd0:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0107cd3:	8b 45 10             	mov    0x10(%ebp),%eax
c0107cd6:	89 45 ec             	mov    %eax,-0x14(%ebp)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
c0107cd9:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0107cdc:	c1 e8 02             	shr    $0x2,%eax
c0107cdf:	89 c1                	mov    %eax,%ecx
    asm volatile (
c0107ce1:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0107ce4:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0107ce7:	89 d7                	mov    %edx,%edi
c0107ce9:	89 c6                	mov    %eax,%esi
c0107ceb:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
c0107ced:	8b 4d ec             	mov    -0x14(%ebp),%ecx
c0107cf0:	83 e1 03             	and    $0x3,%ecx
c0107cf3:	74 02                	je     c0107cf7 <memcpy+0x3c>
c0107cf5:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
c0107cf7:	89 f0                	mov    %esi,%eax
c0107cf9:	89 fa                	mov    %edi,%edx
c0107cfb:	89 4d e8             	mov    %ecx,-0x18(%ebp)
c0107cfe:	89 55 e4             	mov    %edx,-0x1c(%ebp)
c0107d01:	89 45 e0             	mov    %eax,-0x20(%ebp)
    return dst;
c0107d04:	8b 45 f4             	mov    -0xc(%ebp),%eax
    while (n -- > 0) {
        *d ++ = *s ++;
    }
    return dst;
#endif /* __HAVE_ARCH_MEMCPY */
}
c0107d07:	83 c4 20             	add    $0x20,%esp
c0107d0a:	5e                   	pop    %esi
c0107d0b:	5f                   	pop    %edi
c0107d0c:	5d                   	pop    %ebp
c0107d0d:	c3                   	ret    

c0107d0e <memcmp>:
 *   match in both memory blocks has a greater value in @v1 than in @v2
 *   as if evaluated as unsigned char values;
 * - And a value less than zero indicates the opposite.
 * */
int
memcmp(const void *v1, const void *v2, size_t n) {
c0107d0e:	f3 0f 1e fb          	endbr32 
c0107d12:	55                   	push   %ebp
c0107d13:	89 e5                	mov    %esp,%ebp
c0107d15:	83 ec 10             	sub    $0x10,%esp
    const char *s1 = (const char *)v1;
c0107d18:	8b 45 08             	mov    0x8(%ebp),%eax
c0107d1b:	89 45 fc             	mov    %eax,-0x4(%ebp)
    const char *s2 = (const char *)v2;
c0107d1e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0107d21:	89 45 f8             	mov    %eax,-0x8(%ebp)
    while (n -- > 0) {
c0107d24:	eb 30                	jmp    c0107d56 <memcmp+0x48>
        if (*s1 != *s2) {
c0107d26:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0107d29:	0f b6 10             	movzbl (%eax),%edx
c0107d2c:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0107d2f:	0f b6 00             	movzbl (%eax),%eax
c0107d32:	38 c2                	cmp    %al,%dl
c0107d34:	74 18                	je     c0107d4e <memcmp+0x40>
            return (int)((unsigned char)*s1 - (unsigned char)*s2);
c0107d36:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0107d39:	0f b6 00             	movzbl (%eax),%eax
c0107d3c:	0f b6 d0             	movzbl %al,%edx
c0107d3f:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0107d42:	0f b6 00             	movzbl (%eax),%eax
c0107d45:	0f b6 c0             	movzbl %al,%eax
c0107d48:	29 c2                	sub    %eax,%edx
c0107d4a:	89 d0                	mov    %edx,%eax
c0107d4c:	eb 1a                	jmp    c0107d68 <memcmp+0x5a>
        }
        s1 ++, s2 ++;
c0107d4e:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
c0107d52:	83 45 f8 01          	addl   $0x1,-0x8(%ebp)
    while (n -- > 0) {
c0107d56:	8b 45 10             	mov    0x10(%ebp),%eax
c0107d59:	8d 50 ff             	lea    -0x1(%eax),%edx
c0107d5c:	89 55 10             	mov    %edx,0x10(%ebp)
c0107d5f:	85 c0                	test   %eax,%eax
c0107d61:	75 c3                	jne    c0107d26 <memcmp+0x18>
    }
    return 0;
c0107d63:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0107d68:	c9                   	leave  
c0107d69:	c3                   	ret    

c0107d6a <printnum>:
 * @width:      maximum number of digits, if the actual width is less than @width, use @padc instead
 * @padc:       character that padded on the left if the actual width is less than @width
 * */
static void
printnum(void (*putch)(int, void*), void *putdat,
        unsigned long long num, unsigned base, int width, int padc) {
c0107d6a:	f3 0f 1e fb          	endbr32 
c0107d6e:	55                   	push   %ebp
c0107d6f:	89 e5                	mov    %esp,%ebp
c0107d71:	83 ec 38             	sub    $0x38,%esp
c0107d74:	8b 45 10             	mov    0x10(%ebp),%eax
c0107d77:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0107d7a:	8b 45 14             	mov    0x14(%ebp),%eax
c0107d7d:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    unsigned long long result = num;
c0107d80:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0107d83:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0107d86:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0107d89:	89 55 ec             	mov    %edx,-0x14(%ebp)
    unsigned mod = do_div(result, base);
c0107d8c:	8b 45 18             	mov    0x18(%ebp),%eax
c0107d8f:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0107d92:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0107d95:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0107d98:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0107d9b:	89 55 f0             	mov    %edx,-0x10(%ebp)
c0107d9e:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0107da1:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0107da4:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0107da8:	74 1c                	je     c0107dc6 <printnum+0x5c>
c0107daa:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0107dad:	ba 00 00 00 00       	mov    $0x0,%edx
c0107db2:	f7 75 e4             	divl   -0x1c(%ebp)
c0107db5:	89 55 f4             	mov    %edx,-0xc(%ebp)
c0107db8:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0107dbb:	ba 00 00 00 00       	mov    $0x0,%edx
c0107dc0:	f7 75 e4             	divl   -0x1c(%ebp)
c0107dc3:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0107dc6:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0107dc9:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0107dcc:	f7 75 e4             	divl   -0x1c(%ebp)
c0107dcf:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0107dd2:	89 55 dc             	mov    %edx,-0x24(%ebp)
c0107dd5:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0107dd8:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0107ddb:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0107dde:	89 55 ec             	mov    %edx,-0x14(%ebp)
c0107de1:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0107de4:	89 45 d8             	mov    %eax,-0x28(%ebp)

    // first recursively print all preceding (more significant) digits
    if (num >= base) {
c0107de7:	8b 45 18             	mov    0x18(%ebp),%eax
c0107dea:	ba 00 00 00 00       	mov    $0x0,%edx
c0107def:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
c0107df2:	39 45 d0             	cmp    %eax,-0x30(%ebp)
c0107df5:	19 d1                	sbb    %edx,%ecx
c0107df7:	72 37                	jb     c0107e30 <printnum+0xc6>
        printnum(putch, putdat, result, base, width - 1, padc);
c0107df9:	8b 45 1c             	mov    0x1c(%ebp),%eax
c0107dfc:	83 e8 01             	sub    $0x1,%eax
c0107dff:	83 ec 04             	sub    $0x4,%esp
c0107e02:	ff 75 20             	pushl  0x20(%ebp)
c0107e05:	50                   	push   %eax
c0107e06:	ff 75 18             	pushl  0x18(%ebp)
c0107e09:	ff 75 ec             	pushl  -0x14(%ebp)
c0107e0c:	ff 75 e8             	pushl  -0x18(%ebp)
c0107e0f:	ff 75 0c             	pushl  0xc(%ebp)
c0107e12:	ff 75 08             	pushl  0x8(%ebp)
c0107e15:	e8 50 ff ff ff       	call   c0107d6a <printnum>
c0107e1a:	83 c4 20             	add    $0x20,%esp
c0107e1d:	eb 1b                	jmp    c0107e3a <printnum+0xd0>
    } else {
        // print any needed pad characters before first digit
        while (-- width > 0)
            putch(padc, putdat);
c0107e1f:	83 ec 08             	sub    $0x8,%esp
c0107e22:	ff 75 0c             	pushl  0xc(%ebp)
c0107e25:	ff 75 20             	pushl  0x20(%ebp)
c0107e28:	8b 45 08             	mov    0x8(%ebp),%eax
c0107e2b:	ff d0                	call   *%eax
c0107e2d:	83 c4 10             	add    $0x10,%esp
        while (-- width > 0)
c0107e30:	83 6d 1c 01          	subl   $0x1,0x1c(%ebp)
c0107e34:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
c0107e38:	7f e5                	jg     c0107e1f <printnum+0xb5>
    }
    // then print this (the least significant) digit
    putch("0123456789abcdef"[mod], putdat);
c0107e3a:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0107e3d:	05 68 a4 10 c0       	add    $0xc010a468,%eax
c0107e42:	0f b6 00             	movzbl (%eax),%eax
c0107e45:	0f be c0             	movsbl %al,%eax
c0107e48:	83 ec 08             	sub    $0x8,%esp
c0107e4b:	ff 75 0c             	pushl  0xc(%ebp)
c0107e4e:	50                   	push   %eax
c0107e4f:	8b 45 08             	mov    0x8(%ebp),%eax
c0107e52:	ff d0                	call   *%eax
c0107e54:	83 c4 10             	add    $0x10,%esp
}
c0107e57:	90                   	nop
c0107e58:	c9                   	leave  
c0107e59:	c3                   	ret    

c0107e5a <getuint>:
 * getuint - get an unsigned int of various possible sizes from a varargs list
 * @ap:         a varargs list pointer
 * @lflag:      determines the size of the vararg that @ap points to
 * */
static unsigned long long
getuint(va_list *ap, int lflag) {
c0107e5a:	f3 0f 1e fb          	endbr32 
c0107e5e:	55                   	push   %ebp
c0107e5f:	89 e5                	mov    %esp,%ebp
    if (lflag >= 2) {
c0107e61:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
c0107e65:	7e 14                	jle    c0107e7b <getuint+0x21>
        return va_arg(*ap, unsigned long long);
c0107e67:	8b 45 08             	mov    0x8(%ebp),%eax
c0107e6a:	8b 00                	mov    (%eax),%eax
c0107e6c:	8d 48 08             	lea    0x8(%eax),%ecx
c0107e6f:	8b 55 08             	mov    0x8(%ebp),%edx
c0107e72:	89 0a                	mov    %ecx,(%edx)
c0107e74:	8b 50 04             	mov    0x4(%eax),%edx
c0107e77:	8b 00                	mov    (%eax),%eax
c0107e79:	eb 30                	jmp    c0107eab <getuint+0x51>
    }
    else if (lflag) {
c0107e7b:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0107e7f:	74 16                	je     c0107e97 <getuint+0x3d>
        return va_arg(*ap, unsigned long);
c0107e81:	8b 45 08             	mov    0x8(%ebp),%eax
c0107e84:	8b 00                	mov    (%eax),%eax
c0107e86:	8d 48 04             	lea    0x4(%eax),%ecx
c0107e89:	8b 55 08             	mov    0x8(%ebp),%edx
c0107e8c:	89 0a                	mov    %ecx,(%edx)
c0107e8e:	8b 00                	mov    (%eax),%eax
c0107e90:	ba 00 00 00 00       	mov    $0x0,%edx
c0107e95:	eb 14                	jmp    c0107eab <getuint+0x51>
    }
    else {
        return va_arg(*ap, unsigned int);
c0107e97:	8b 45 08             	mov    0x8(%ebp),%eax
c0107e9a:	8b 00                	mov    (%eax),%eax
c0107e9c:	8d 48 04             	lea    0x4(%eax),%ecx
c0107e9f:	8b 55 08             	mov    0x8(%ebp),%edx
c0107ea2:	89 0a                	mov    %ecx,(%edx)
c0107ea4:	8b 00                	mov    (%eax),%eax
c0107ea6:	ba 00 00 00 00       	mov    $0x0,%edx
    }
}
c0107eab:	5d                   	pop    %ebp
c0107eac:	c3                   	ret    

c0107ead <getint>:
 * getint - same as getuint but signed, we can't use getuint because of sign extension
 * @ap:         a varargs list pointer
 * @lflag:      determines the size of the vararg that @ap points to
 * */
static long long
getint(va_list *ap, int lflag) {
c0107ead:	f3 0f 1e fb          	endbr32 
c0107eb1:	55                   	push   %ebp
c0107eb2:	89 e5                	mov    %esp,%ebp
    if (lflag >= 2) {
c0107eb4:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
c0107eb8:	7e 14                	jle    c0107ece <getint+0x21>
        return va_arg(*ap, long long);
c0107eba:	8b 45 08             	mov    0x8(%ebp),%eax
c0107ebd:	8b 00                	mov    (%eax),%eax
c0107ebf:	8d 48 08             	lea    0x8(%eax),%ecx
c0107ec2:	8b 55 08             	mov    0x8(%ebp),%edx
c0107ec5:	89 0a                	mov    %ecx,(%edx)
c0107ec7:	8b 50 04             	mov    0x4(%eax),%edx
c0107eca:	8b 00                	mov    (%eax),%eax
c0107ecc:	eb 28                	jmp    c0107ef6 <getint+0x49>
    }
    else if (lflag) {
c0107ece:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0107ed2:	74 12                	je     c0107ee6 <getint+0x39>
        return va_arg(*ap, long);
c0107ed4:	8b 45 08             	mov    0x8(%ebp),%eax
c0107ed7:	8b 00                	mov    (%eax),%eax
c0107ed9:	8d 48 04             	lea    0x4(%eax),%ecx
c0107edc:	8b 55 08             	mov    0x8(%ebp),%edx
c0107edf:	89 0a                	mov    %ecx,(%edx)
c0107ee1:	8b 00                	mov    (%eax),%eax
c0107ee3:	99                   	cltd   
c0107ee4:	eb 10                	jmp    c0107ef6 <getint+0x49>
    }
    else {
        return va_arg(*ap, int);
c0107ee6:	8b 45 08             	mov    0x8(%ebp),%eax
c0107ee9:	8b 00                	mov    (%eax),%eax
c0107eeb:	8d 48 04             	lea    0x4(%eax),%ecx
c0107eee:	8b 55 08             	mov    0x8(%ebp),%edx
c0107ef1:	89 0a                	mov    %ecx,(%edx)
c0107ef3:	8b 00                	mov    (%eax),%eax
c0107ef5:	99                   	cltd   
    }
}
c0107ef6:	5d                   	pop    %ebp
c0107ef7:	c3                   	ret    

c0107ef8 <printfmt>:
 * @putch:      specified putch function, print a single character
 * @putdat:     used by @putch function
 * @fmt:        the format string to use
 * */
void
printfmt(void (*putch)(int, void*), void *putdat, const char *fmt, ...) {
c0107ef8:	f3 0f 1e fb          	endbr32 
c0107efc:	55                   	push   %ebp
c0107efd:	89 e5                	mov    %esp,%ebp
c0107eff:	83 ec 18             	sub    $0x18,%esp
    va_list ap;

    va_start(ap, fmt);
c0107f02:	8d 45 14             	lea    0x14(%ebp),%eax
c0107f05:	89 45 f4             	mov    %eax,-0xc(%ebp)
    vprintfmt(putch, putdat, fmt, ap);
c0107f08:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0107f0b:	50                   	push   %eax
c0107f0c:	ff 75 10             	pushl  0x10(%ebp)
c0107f0f:	ff 75 0c             	pushl  0xc(%ebp)
c0107f12:	ff 75 08             	pushl  0x8(%ebp)
c0107f15:	e8 06 00 00 00       	call   c0107f20 <vprintfmt>
c0107f1a:	83 c4 10             	add    $0x10,%esp
    va_end(ap);
}
c0107f1d:	90                   	nop
c0107f1e:	c9                   	leave  
c0107f1f:	c3                   	ret    

c0107f20 <vprintfmt>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want printfmt() instead.
 * */
void
vprintfmt(void (*putch)(int, void*), void *putdat, const char *fmt, va_list ap) {
c0107f20:	f3 0f 1e fb          	endbr32 
c0107f24:	55                   	push   %ebp
c0107f25:	89 e5                	mov    %esp,%ebp
c0107f27:	56                   	push   %esi
c0107f28:	53                   	push   %ebx
c0107f29:	83 ec 20             	sub    $0x20,%esp
    register int ch, err;
    unsigned long long num;
    int base, width, precision, lflag, altflag;

    while (1) {
        while ((ch = *(unsigned char *)fmt ++) != '%') {
c0107f2c:	eb 17                	jmp    c0107f45 <vprintfmt+0x25>
            if (ch == '\0') {
c0107f2e:	85 db                	test   %ebx,%ebx
c0107f30:	0f 84 8f 03 00 00    	je     c01082c5 <vprintfmt+0x3a5>
                return;
            }
            putch(ch, putdat);
c0107f36:	83 ec 08             	sub    $0x8,%esp
c0107f39:	ff 75 0c             	pushl  0xc(%ebp)
c0107f3c:	53                   	push   %ebx
c0107f3d:	8b 45 08             	mov    0x8(%ebp),%eax
c0107f40:	ff d0                	call   *%eax
c0107f42:	83 c4 10             	add    $0x10,%esp
        while ((ch = *(unsigned char *)fmt ++) != '%') {
c0107f45:	8b 45 10             	mov    0x10(%ebp),%eax
c0107f48:	8d 50 01             	lea    0x1(%eax),%edx
c0107f4b:	89 55 10             	mov    %edx,0x10(%ebp)
c0107f4e:	0f b6 00             	movzbl (%eax),%eax
c0107f51:	0f b6 d8             	movzbl %al,%ebx
c0107f54:	83 fb 25             	cmp    $0x25,%ebx
c0107f57:	75 d5                	jne    c0107f2e <vprintfmt+0xe>
        }

        // Process a %-escape sequence
        char padc = ' ';
c0107f59:	c6 45 db 20          	movb   $0x20,-0x25(%ebp)
        width = precision = -1;
c0107f5d:	c7 45 e4 ff ff ff ff 	movl   $0xffffffff,-0x1c(%ebp)
c0107f64:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0107f67:	89 45 e8             	mov    %eax,-0x18(%ebp)
        lflag = altflag = 0;
c0107f6a:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c0107f71:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0107f74:	89 45 e0             	mov    %eax,-0x20(%ebp)

    reswitch:
        switch (ch = *(unsigned char *)fmt ++) {
c0107f77:	8b 45 10             	mov    0x10(%ebp),%eax
c0107f7a:	8d 50 01             	lea    0x1(%eax),%edx
c0107f7d:	89 55 10             	mov    %edx,0x10(%ebp)
c0107f80:	0f b6 00             	movzbl (%eax),%eax
c0107f83:	0f b6 d8             	movzbl %al,%ebx
c0107f86:	8d 43 dd             	lea    -0x23(%ebx),%eax
c0107f89:	83 f8 55             	cmp    $0x55,%eax
c0107f8c:	0f 87 06 03 00 00    	ja     c0108298 <vprintfmt+0x378>
c0107f92:	8b 04 85 8c a4 10 c0 	mov    -0x3fef5b74(,%eax,4),%eax
c0107f99:	3e ff e0             	notrack jmp *%eax

        // flag to pad on the right
        case '-':
            padc = '-';
c0107f9c:	c6 45 db 2d          	movb   $0x2d,-0x25(%ebp)
            goto reswitch;
c0107fa0:	eb d5                	jmp    c0107f77 <vprintfmt+0x57>

        // flag to pad with 0's instead of spaces
        case '0':
            padc = '0';
c0107fa2:	c6 45 db 30          	movb   $0x30,-0x25(%ebp)
            goto reswitch;
c0107fa6:	eb cf                	jmp    c0107f77 <vprintfmt+0x57>

        // width field
        case '1' ... '9':
            for (precision = 0; ; ++ fmt) {
c0107fa8:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
                precision = precision * 10 + ch - '0';
c0107faf:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0107fb2:	89 d0                	mov    %edx,%eax
c0107fb4:	c1 e0 02             	shl    $0x2,%eax
c0107fb7:	01 d0                	add    %edx,%eax
c0107fb9:	01 c0                	add    %eax,%eax
c0107fbb:	01 d8                	add    %ebx,%eax
c0107fbd:	83 e8 30             	sub    $0x30,%eax
c0107fc0:	89 45 e4             	mov    %eax,-0x1c(%ebp)
                ch = *fmt;
c0107fc3:	8b 45 10             	mov    0x10(%ebp),%eax
c0107fc6:	0f b6 00             	movzbl (%eax),%eax
c0107fc9:	0f be d8             	movsbl %al,%ebx
                if (ch < '0' || ch > '9') {
c0107fcc:	83 fb 2f             	cmp    $0x2f,%ebx
c0107fcf:	7e 39                	jle    c010800a <vprintfmt+0xea>
c0107fd1:	83 fb 39             	cmp    $0x39,%ebx
c0107fd4:	7f 34                	jg     c010800a <vprintfmt+0xea>
            for (precision = 0; ; ++ fmt) {
c0107fd6:	83 45 10 01          	addl   $0x1,0x10(%ebp)
                precision = precision * 10 + ch - '0';
c0107fda:	eb d3                	jmp    c0107faf <vprintfmt+0x8f>
                }
            }
            goto process_precision;

        case '*':
            precision = va_arg(ap, int);
c0107fdc:	8b 45 14             	mov    0x14(%ebp),%eax
c0107fdf:	8d 50 04             	lea    0x4(%eax),%edx
c0107fe2:	89 55 14             	mov    %edx,0x14(%ebp)
c0107fe5:	8b 00                	mov    (%eax),%eax
c0107fe7:	89 45 e4             	mov    %eax,-0x1c(%ebp)
            goto process_precision;
c0107fea:	eb 1f                	jmp    c010800b <vprintfmt+0xeb>

        case '.':
            if (width < 0)
c0107fec:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0107ff0:	79 85                	jns    c0107f77 <vprintfmt+0x57>
                width = 0;
c0107ff2:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
            goto reswitch;
c0107ff9:	e9 79 ff ff ff       	jmp    c0107f77 <vprintfmt+0x57>

        case '#':
            altflag = 1;
c0107ffe:	c7 45 dc 01 00 00 00 	movl   $0x1,-0x24(%ebp)
            goto reswitch;
c0108005:	e9 6d ff ff ff       	jmp    c0107f77 <vprintfmt+0x57>
            goto process_precision;
c010800a:	90                   	nop

        process_precision:
            if (width < 0)
c010800b:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c010800f:	0f 89 62 ff ff ff    	jns    c0107f77 <vprintfmt+0x57>
                width = precision, precision = -1;
c0108015:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0108018:	89 45 e8             	mov    %eax,-0x18(%ebp)
c010801b:	c7 45 e4 ff ff ff ff 	movl   $0xffffffff,-0x1c(%ebp)
            goto reswitch;
c0108022:	e9 50 ff ff ff       	jmp    c0107f77 <vprintfmt+0x57>

        // long flag (doubled for long long)
        case 'l':
            lflag ++;
c0108027:	83 45 e0 01          	addl   $0x1,-0x20(%ebp)
            goto reswitch;
c010802b:	e9 47 ff ff ff       	jmp    c0107f77 <vprintfmt+0x57>

        // character
        case 'c':
            putch(va_arg(ap, int), putdat);
c0108030:	8b 45 14             	mov    0x14(%ebp),%eax
c0108033:	8d 50 04             	lea    0x4(%eax),%edx
c0108036:	89 55 14             	mov    %edx,0x14(%ebp)
c0108039:	8b 00                	mov    (%eax),%eax
c010803b:	83 ec 08             	sub    $0x8,%esp
c010803e:	ff 75 0c             	pushl  0xc(%ebp)
c0108041:	50                   	push   %eax
c0108042:	8b 45 08             	mov    0x8(%ebp),%eax
c0108045:	ff d0                	call   *%eax
c0108047:	83 c4 10             	add    $0x10,%esp
            break;
c010804a:	e9 71 02 00 00       	jmp    c01082c0 <vprintfmt+0x3a0>

        // error message
        case 'e':
            err = va_arg(ap, int);
c010804f:	8b 45 14             	mov    0x14(%ebp),%eax
c0108052:	8d 50 04             	lea    0x4(%eax),%edx
c0108055:	89 55 14             	mov    %edx,0x14(%ebp)
c0108058:	8b 18                	mov    (%eax),%ebx
            if (err < 0) {
c010805a:	85 db                	test   %ebx,%ebx
c010805c:	79 02                	jns    c0108060 <vprintfmt+0x140>
                err = -err;
c010805e:	f7 db                	neg    %ebx
            }
            if (err > MAXERROR || (p = error_string[err]) == NULL) {
c0108060:	83 fb 06             	cmp    $0x6,%ebx
c0108063:	7f 0b                	jg     c0108070 <vprintfmt+0x150>
c0108065:	8b 34 9d 4c a4 10 c0 	mov    -0x3fef5bb4(,%ebx,4),%esi
c010806c:	85 f6                	test   %esi,%esi
c010806e:	75 19                	jne    c0108089 <vprintfmt+0x169>
                printfmt(putch, putdat, "error %d", err);
c0108070:	53                   	push   %ebx
c0108071:	68 79 a4 10 c0       	push   $0xc010a479
c0108076:	ff 75 0c             	pushl  0xc(%ebp)
c0108079:	ff 75 08             	pushl  0x8(%ebp)
c010807c:	e8 77 fe ff ff       	call   c0107ef8 <printfmt>
c0108081:	83 c4 10             	add    $0x10,%esp
            }
            else {
                printfmt(putch, putdat, "%s", p);
            }
            break;
c0108084:	e9 37 02 00 00       	jmp    c01082c0 <vprintfmt+0x3a0>
                printfmt(putch, putdat, "%s", p);
c0108089:	56                   	push   %esi
c010808a:	68 82 a4 10 c0       	push   $0xc010a482
c010808f:	ff 75 0c             	pushl  0xc(%ebp)
c0108092:	ff 75 08             	pushl  0x8(%ebp)
c0108095:	e8 5e fe ff ff       	call   c0107ef8 <printfmt>
c010809a:	83 c4 10             	add    $0x10,%esp
            break;
c010809d:	e9 1e 02 00 00       	jmp    c01082c0 <vprintfmt+0x3a0>

        // string
        case 's':
            if ((p = va_arg(ap, char *)) == NULL) {
c01080a2:	8b 45 14             	mov    0x14(%ebp),%eax
c01080a5:	8d 50 04             	lea    0x4(%eax),%edx
c01080a8:	89 55 14             	mov    %edx,0x14(%ebp)
c01080ab:	8b 30                	mov    (%eax),%esi
c01080ad:	85 f6                	test   %esi,%esi
c01080af:	75 05                	jne    c01080b6 <vprintfmt+0x196>
                p = "(null)";
c01080b1:	be 85 a4 10 c0       	mov    $0xc010a485,%esi
            }
            if (width > 0 && padc != '-') {
c01080b6:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c01080ba:	7e 76                	jle    c0108132 <vprintfmt+0x212>
c01080bc:	80 7d db 2d          	cmpb   $0x2d,-0x25(%ebp)
c01080c0:	74 70                	je     c0108132 <vprintfmt+0x212>
                for (width -= strnlen(p, precision); width > 0; width --) {
c01080c2:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01080c5:	83 ec 08             	sub    $0x8,%esp
c01080c8:	50                   	push   %eax
c01080c9:	56                   	push   %esi
c01080ca:	e8 db f7 ff ff       	call   c01078aa <strnlen>
c01080cf:	83 c4 10             	add    $0x10,%esp
c01080d2:	8b 55 e8             	mov    -0x18(%ebp),%edx
c01080d5:	29 c2                	sub    %eax,%edx
c01080d7:	89 d0                	mov    %edx,%eax
c01080d9:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01080dc:	eb 17                	jmp    c01080f5 <vprintfmt+0x1d5>
                    putch(padc, putdat);
c01080de:	0f be 45 db          	movsbl -0x25(%ebp),%eax
c01080e2:	83 ec 08             	sub    $0x8,%esp
c01080e5:	ff 75 0c             	pushl  0xc(%ebp)
c01080e8:	50                   	push   %eax
c01080e9:	8b 45 08             	mov    0x8(%ebp),%eax
c01080ec:	ff d0                	call   *%eax
c01080ee:	83 c4 10             	add    $0x10,%esp
                for (width -= strnlen(p, precision); width > 0; width --) {
c01080f1:	83 6d e8 01          	subl   $0x1,-0x18(%ebp)
c01080f5:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c01080f9:	7f e3                	jg     c01080de <vprintfmt+0x1be>
                }
            }
            for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
c01080fb:	eb 35                	jmp    c0108132 <vprintfmt+0x212>
                if (altflag && (ch < ' ' || ch > '~')) {
c01080fd:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
c0108101:	74 1c                	je     c010811f <vprintfmt+0x1ff>
c0108103:	83 fb 1f             	cmp    $0x1f,%ebx
c0108106:	7e 05                	jle    c010810d <vprintfmt+0x1ed>
c0108108:	83 fb 7e             	cmp    $0x7e,%ebx
c010810b:	7e 12                	jle    c010811f <vprintfmt+0x1ff>
                    putch('?', putdat);
c010810d:	83 ec 08             	sub    $0x8,%esp
c0108110:	ff 75 0c             	pushl  0xc(%ebp)
c0108113:	6a 3f                	push   $0x3f
c0108115:	8b 45 08             	mov    0x8(%ebp),%eax
c0108118:	ff d0                	call   *%eax
c010811a:	83 c4 10             	add    $0x10,%esp
c010811d:	eb 0f                	jmp    c010812e <vprintfmt+0x20e>
                }
                else {
                    putch(ch, putdat);
c010811f:	83 ec 08             	sub    $0x8,%esp
c0108122:	ff 75 0c             	pushl  0xc(%ebp)
c0108125:	53                   	push   %ebx
c0108126:	8b 45 08             	mov    0x8(%ebp),%eax
c0108129:	ff d0                	call   *%eax
c010812b:	83 c4 10             	add    $0x10,%esp
            for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
c010812e:	83 6d e8 01          	subl   $0x1,-0x18(%ebp)
c0108132:	89 f0                	mov    %esi,%eax
c0108134:	8d 70 01             	lea    0x1(%eax),%esi
c0108137:	0f b6 00             	movzbl (%eax),%eax
c010813a:	0f be d8             	movsbl %al,%ebx
c010813d:	85 db                	test   %ebx,%ebx
c010813f:	74 26                	je     c0108167 <vprintfmt+0x247>
c0108141:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c0108145:	78 b6                	js     c01080fd <vprintfmt+0x1dd>
c0108147:	83 6d e4 01          	subl   $0x1,-0x1c(%ebp)
c010814b:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c010814f:	79 ac                	jns    c01080fd <vprintfmt+0x1dd>
                }
            }
            for (; width > 0; width --) {
c0108151:	eb 14                	jmp    c0108167 <vprintfmt+0x247>
                putch(' ', putdat);
c0108153:	83 ec 08             	sub    $0x8,%esp
c0108156:	ff 75 0c             	pushl  0xc(%ebp)
c0108159:	6a 20                	push   $0x20
c010815b:	8b 45 08             	mov    0x8(%ebp),%eax
c010815e:	ff d0                	call   *%eax
c0108160:	83 c4 10             	add    $0x10,%esp
            for (; width > 0; width --) {
c0108163:	83 6d e8 01          	subl   $0x1,-0x18(%ebp)
c0108167:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c010816b:	7f e6                	jg     c0108153 <vprintfmt+0x233>
            }
            break;
c010816d:	e9 4e 01 00 00       	jmp    c01082c0 <vprintfmt+0x3a0>

        // (signed) decimal
        case 'd':
            num = getint(&ap, lflag);
c0108172:	83 ec 08             	sub    $0x8,%esp
c0108175:	ff 75 e0             	pushl  -0x20(%ebp)
c0108178:	8d 45 14             	lea    0x14(%ebp),%eax
c010817b:	50                   	push   %eax
c010817c:	e8 2c fd ff ff       	call   c0107ead <getint>
c0108181:	83 c4 10             	add    $0x10,%esp
c0108184:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0108187:	89 55 f4             	mov    %edx,-0xc(%ebp)
            if ((long long)num < 0) {
c010818a:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010818d:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0108190:	85 d2                	test   %edx,%edx
c0108192:	79 23                	jns    c01081b7 <vprintfmt+0x297>
                putch('-', putdat);
c0108194:	83 ec 08             	sub    $0x8,%esp
c0108197:	ff 75 0c             	pushl  0xc(%ebp)
c010819a:	6a 2d                	push   $0x2d
c010819c:	8b 45 08             	mov    0x8(%ebp),%eax
c010819f:	ff d0                	call   *%eax
c01081a1:	83 c4 10             	add    $0x10,%esp
                num = -(long long)num;
c01081a4:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01081a7:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01081aa:	f7 d8                	neg    %eax
c01081ac:	83 d2 00             	adc    $0x0,%edx
c01081af:	f7 da                	neg    %edx
c01081b1:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01081b4:	89 55 f4             	mov    %edx,-0xc(%ebp)
            }
            base = 10;
c01081b7:	c7 45 ec 0a 00 00 00 	movl   $0xa,-0x14(%ebp)
            goto number;
c01081be:	e9 9f 00 00 00       	jmp    c0108262 <vprintfmt+0x342>

        // unsigned decimal
        case 'u':
            num = getuint(&ap, lflag);
c01081c3:	83 ec 08             	sub    $0x8,%esp
c01081c6:	ff 75 e0             	pushl  -0x20(%ebp)
c01081c9:	8d 45 14             	lea    0x14(%ebp),%eax
c01081cc:	50                   	push   %eax
c01081cd:	e8 88 fc ff ff       	call   c0107e5a <getuint>
c01081d2:	83 c4 10             	add    $0x10,%esp
c01081d5:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01081d8:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 10;
c01081db:	c7 45 ec 0a 00 00 00 	movl   $0xa,-0x14(%ebp)
            goto number;
c01081e2:	eb 7e                	jmp    c0108262 <vprintfmt+0x342>

        // (unsigned) octal
        case 'o':
            num = getuint(&ap, lflag);
c01081e4:	83 ec 08             	sub    $0x8,%esp
c01081e7:	ff 75 e0             	pushl  -0x20(%ebp)
c01081ea:	8d 45 14             	lea    0x14(%ebp),%eax
c01081ed:	50                   	push   %eax
c01081ee:	e8 67 fc ff ff       	call   c0107e5a <getuint>
c01081f3:	83 c4 10             	add    $0x10,%esp
c01081f6:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01081f9:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 8;
c01081fc:	c7 45 ec 08 00 00 00 	movl   $0x8,-0x14(%ebp)
            goto number;
c0108203:	eb 5d                	jmp    c0108262 <vprintfmt+0x342>

        // pointer
        case 'p':
            putch('0', putdat);
c0108205:	83 ec 08             	sub    $0x8,%esp
c0108208:	ff 75 0c             	pushl  0xc(%ebp)
c010820b:	6a 30                	push   $0x30
c010820d:	8b 45 08             	mov    0x8(%ebp),%eax
c0108210:	ff d0                	call   *%eax
c0108212:	83 c4 10             	add    $0x10,%esp
            putch('x', putdat);
c0108215:	83 ec 08             	sub    $0x8,%esp
c0108218:	ff 75 0c             	pushl  0xc(%ebp)
c010821b:	6a 78                	push   $0x78
c010821d:	8b 45 08             	mov    0x8(%ebp),%eax
c0108220:	ff d0                	call   *%eax
c0108222:	83 c4 10             	add    $0x10,%esp
            num = (unsigned long long)(uintptr_t)va_arg(ap, void *);
c0108225:	8b 45 14             	mov    0x14(%ebp),%eax
c0108228:	8d 50 04             	lea    0x4(%eax),%edx
c010822b:	89 55 14             	mov    %edx,0x14(%ebp)
c010822e:	8b 00                	mov    (%eax),%eax
c0108230:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0108233:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
            base = 16;
c010823a:	c7 45 ec 10 00 00 00 	movl   $0x10,-0x14(%ebp)
            goto number;
c0108241:	eb 1f                	jmp    c0108262 <vprintfmt+0x342>

        // (unsigned) hexadecimal
        case 'x':
            num = getuint(&ap, lflag);
c0108243:	83 ec 08             	sub    $0x8,%esp
c0108246:	ff 75 e0             	pushl  -0x20(%ebp)
c0108249:	8d 45 14             	lea    0x14(%ebp),%eax
c010824c:	50                   	push   %eax
c010824d:	e8 08 fc ff ff       	call   c0107e5a <getuint>
c0108252:	83 c4 10             	add    $0x10,%esp
c0108255:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0108258:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 16;
c010825b:	c7 45 ec 10 00 00 00 	movl   $0x10,-0x14(%ebp)
        number:
            printnum(putch, putdat, num, base, width, padc);
c0108262:	0f be 55 db          	movsbl -0x25(%ebp),%edx
c0108266:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0108269:	83 ec 04             	sub    $0x4,%esp
c010826c:	52                   	push   %edx
c010826d:	ff 75 e8             	pushl  -0x18(%ebp)
c0108270:	50                   	push   %eax
c0108271:	ff 75 f4             	pushl  -0xc(%ebp)
c0108274:	ff 75 f0             	pushl  -0x10(%ebp)
c0108277:	ff 75 0c             	pushl  0xc(%ebp)
c010827a:	ff 75 08             	pushl  0x8(%ebp)
c010827d:	e8 e8 fa ff ff       	call   c0107d6a <printnum>
c0108282:	83 c4 20             	add    $0x20,%esp
            break;
c0108285:	eb 39                	jmp    c01082c0 <vprintfmt+0x3a0>

        // escaped '%' character
        case '%':
            putch(ch, putdat);
c0108287:	83 ec 08             	sub    $0x8,%esp
c010828a:	ff 75 0c             	pushl  0xc(%ebp)
c010828d:	53                   	push   %ebx
c010828e:	8b 45 08             	mov    0x8(%ebp),%eax
c0108291:	ff d0                	call   *%eax
c0108293:	83 c4 10             	add    $0x10,%esp
            break;
c0108296:	eb 28                	jmp    c01082c0 <vprintfmt+0x3a0>

        // unrecognized escape sequence - just print it literally
        default:
            putch('%', putdat);
c0108298:	83 ec 08             	sub    $0x8,%esp
c010829b:	ff 75 0c             	pushl  0xc(%ebp)
c010829e:	6a 25                	push   $0x25
c01082a0:	8b 45 08             	mov    0x8(%ebp),%eax
c01082a3:	ff d0                	call   *%eax
c01082a5:	83 c4 10             	add    $0x10,%esp
            for (fmt --; fmt[-1] != '%'; fmt --)
c01082a8:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
c01082ac:	eb 04                	jmp    c01082b2 <vprintfmt+0x392>
c01082ae:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
c01082b2:	8b 45 10             	mov    0x10(%ebp),%eax
c01082b5:	83 e8 01             	sub    $0x1,%eax
c01082b8:	0f b6 00             	movzbl (%eax),%eax
c01082bb:	3c 25                	cmp    $0x25,%al
c01082bd:	75 ef                	jne    c01082ae <vprintfmt+0x38e>
                /* do nothing */;
            break;
c01082bf:	90                   	nop
    while (1) {
c01082c0:	e9 67 fc ff ff       	jmp    c0107f2c <vprintfmt+0xc>
                return;
c01082c5:	90                   	nop
        }
    }
}
c01082c6:	8d 65 f8             	lea    -0x8(%ebp),%esp
c01082c9:	5b                   	pop    %ebx
c01082ca:	5e                   	pop    %esi
c01082cb:	5d                   	pop    %ebp
c01082cc:	c3                   	ret    

c01082cd <sprintputch>:
 * sprintputch - 'print' a single character in a buffer
 * @ch:         the character will be printed
 * @b:          the buffer to place the character @ch
 * */
static void
sprintputch(int ch, struct sprintbuf *b) {
c01082cd:	f3 0f 1e fb          	endbr32 
c01082d1:	55                   	push   %ebp
c01082d2:	89 e5                	mov    %esp,%ebp
    b->cnt ++;
c01082d4:	8b 45 0c             	mov    0xc(%ebp),%eax
c01082d7:	8b 40 08             	mov    0x8(%eax),%eax
c01082da:	8d 50 01             	lea    0x1(%eax),%edx
c01082dd:	8b 45 0c             	mov    0xc(%ebp),%eax
c01082e0:	89 50 08             	mov    %edx,0x8(%eax)
    if (b->buf < b->ebuf) {
c01082e3:	8b 45 0c             	mov    0xc(%ebp),%eax
c01082e6:	8b 10                	mov    (%eax),%edx
c01082e8:	8b 45 0c             	mov    0xc(%ebp),%eax
c01082eb:	8b 40 04             	mov    0x4(%eax),%eax
c01082ee:	39 c2                	cmp    %eax,%edx
c01082f0:	73 12                	jae    c0108304 <sprintputch+0x37>
        *b->buf ++ = ch;
c01082f2:	8b 45 0c             	mov    0xc(%ebp),%eax
c01082f5:	8b 00                	mov    (%eax),%eax
c01082f7:	8d 48 01             	lea    0x1(%eax),%ecx
c01082fa:	8b 55 0c             	mov    0xc(%ebp),%edx
c01082fd:	89 0a                	mov    %ecx,(%edx)
c01082ff:	8b 55 08             	mov    0x8(%ebp),%edx
c0108302:	88 10                	mov    %dl,(%eax)
    }
}
c0108304:	90                   	nop
c0108305:	5d                   	pop    %ebp
c0108306:	c3                   	ret    

c0108307 <snprintf>:
 * @str:        the buffer to place the result into
 * @size:       the size of buffer, including the trailing null space
 * @fmt:        the format string to use
 * */
int
snprintf(char *str, size_t size, const char *fmt, ...) {
c0108307:	f3 0f 1e fb          	endbr32 
c010830b:	55                   	push   %ebp
c010830c:	89 e5                	mov    %esp,%ebp
c010830e:	83 ec 18             	sub    $0x18,%esp
    va_list ap;
    int cnt;
    va_start(ap, fmt);
c0108311:	8d 45 14             	lea    0x14(%ebp),%eax
c0108314:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cnt = vsnprintf(str, size, fmt, ap);
c0108317:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010831a:	50                   	push   %eax
c010831b:	ff 75 10             	pushl  0x10(%ebp)
c010831e:	ff 75 0c             	pushl  0xc(%ebp)
c0108321:	ff 75 08             	pushl  0x8(%ebp)
c0108324:	e8 0b 00 00 00       	call   c0108334 <vsnprintf>
c0108329:	83 c4 10             	add    $0x10,%esp
c010832c:	89 45 f4             	mov    %eax,-0xc(%ebp)
    va_end(ap);
    return cnt;
c010832f:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0108332:	c9                   	leave  
c0108333:	c3                   	ret    

c0108334 <vsnprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want snprintf() instead.
 * */
int
vsnprintf(char *str, size_t size, const char *fmt, va_list ap) {
c0108334:	f3 0f 1e fb          	endbr32 
c0108338:	55                   	push   %ebp
c0108339:	89 e5                	mov    %esp,%ebp
c010833b:	83 ec 18             	sub    $0x18,%esp
    struct sprintbuf b = {str, str + size - 1, 0};
c010833e:	8b 45 08             	mov    0x8(%ebp),%eax
c0108341:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0108344:	8b 45 0c             	mov    0xc(%ebp),%eax
c0108347:	8d 50 ff             	lea    -0x1(%eax),%edx
c010834a:	8b 45 08             	mov    0x8(%ebp),%eax
c010834d:	01 d0                	add    %edx,%eax
c010834f:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0108352:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    if (str == NULL || b.buf > b.ebuf) {
c0108359:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c010835d:	74 0a                	je     c0108369 <vsnprintf+0x35>
c010835f:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0108362:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0108365:	39 c2                	cmp    %eax,%edx
c0108367:	76 07                	jbe    c0108370 <vsnprintf+0x3c>
        return -E_INVAL;
c0108369:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
c010836e:	eb 20                	jmp    c0108390 <vsnprintf+0x5c>
    }
    // print the string to the buffer
    vprintfmt((void*)sprintputch, &b, fmt, ap);
c0108370:	ff 75 14             	pushl  0x14(%ebp)
c0108373:	ff 75 10             	pushl  0x10(%ebp)
c0108376:	8d 45 ec             	lea    -0x14(%ebp),%eax
c0108379:	50                   	push   %eax
c010837a:	68 cd 82 10 c0       	push   $0xc01082cd
c010837f:	e8 9c fb ff ff       	call   c0107f20 <vprintfmt>
c0108384:	83 c4 10             	add    $0x10,%esp
    // null terminate the buffer
    *b.buf = '\0';
c0108387:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010838a:	c6 00 00             	movb   $0x0,(%eax)
    return b.cnt;
c010838d:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0108390:	c9                   	leave  
c0108391:	c3                   	ret    

c0108392 <rand>:
 * rand - returns a pseudo-random integer
 *
 * The rand() function return a value in the range [0, RAND_MAX].
 * */
int
rand(void) {
c0108392:	f3 0f 1e fb          	endbr32 
c0108396:	55                   	push   %ebp
c0108397:	89 e5                	mov    %esp,%ebp
c0108399:	57                   	push   %edi
c010839a:	56                   	push   %esi
c010839b:	53                   	push   %ebx
c010839c:	83 ec 24             	sub    $0x24,%esp
    next = (next * 0x5DEECE66DLL + 0xBLL) & ((1LL << 48) - 1);
c010839f:	a1 58 2a 12 c0       	mov    0xc0122a58,%eax
c01083a4:	8b 15 5c 2a 12 c0    	mov    0xc0122a5c,%edx
c01083aa:	69 fa 6d e6 ec de    	imul   $0xdeece66d,%edx,%edi
c01083b0:	6b f0 05             	imul   $0x5,%eax,%esi
c01083b3:	01 fe                	add    %edi,%esi
c01083b5:	bf 6d e6 ec de       	mov    $0xdeece66d,%edi
c01083ba:	f7 e7                	mul    %edi
c01083bc:	01 d6                	add    %edx,%esi
c01083be:	89 f2                	mov    %esi,%edx
c01083c0:	83 c0 0b             	add    $0xb,%eax
c01083c3:	83 d2 00             	adc    $0x0,%edx
c01083c6:	89 c7                	mov    %eax,%edi
c01083c8:	83 e7 ff             	and    $0xffffffff,%edi
c01083cb:	89 f9                	mov    %edi,%ecx
c01083cd:	0f b7 da             	movzwl %dx,%ebx
c01083d0:	89 0d 58 2a 12 c0    	mov    %ecx,0xc0122a58
c01083d6:	89 1d 5c 2a 12 c0    	mov    %ebx,0xc0122a5c
    unsigned long long result = (next >> 12);
c01083dc:	a1 58 2a 12 c0       	mov    0xc0122a58,%eax
c01083e1:	8b 15 5c 2a 12 c0    	mov    0xc0122a5c,%edx
c01083e7:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
c01083eb:	c1 ea 0c             	shr    $0xc,%edx
c01083ee:	89 45 e0             	mov    %eax,-0x20(%ebp)
c01083f1:	89 55 e4             	mov    %edx,-0x1c(%ebp)
    return (int)do_div(result, RAND_MAX + 1);
c01083f4:	c7 45 dc 00 00 00 80 	movl   $0x80000000,-0x24(%ebp)
c01083fb:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01083fe:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0108401:	89 45 d8             	mov    %eax,-0x28(%ebp)
c0108404:	89 55 e8             	mov    %edx,-0x18(%ebp)
c0108407:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010840a:	89 45 ec             	mov    %eax,-0x14(%ebp)
c010840d:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0108411:	74 1c                	je     c010842f <rand+0x9d>
c0108413:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0108416:	ba 00 00 00 00       	mov    $0x0,%edx
c010841b:	f7 75 dc             	divl   -0x24(%ebp)
c010841e:	89 55 ec             	mov    %edx,-0x14(%ebp)
c0108421:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0108424:	ba 00 00 00 00       	mov    $0x0,%edx
c0108429:	f7 75 dc             	divl   -0x24(%ebp)
c010842c:	89 45 e8             	mov    %eax,-0x18(%ebp)
c010842f:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0108432:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0108435:	f7 75 dc             	divl   -0x24(%ebp)
c0108438:	89 45 d8             	mov    %eax,-0x28(%ebp)
c010843b:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c010843e:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0108441:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0108444:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0108447:	89 55 e4             	mov    %edx,-0x1c(%ebp)
c010844a:	8b 45 d4             	mov    -0x2c(%ebp),%eax
}
c010844d:	83 c4 24             	add    $0x24,%esp
c0108450:	5b                   	pop    %ebx
c0108451:	5e                   	pop    %esi
c0108452:	5f                   	pop    %edi
c0108453:	5d                   	pop    %ebp
c0108454:	c3                   	ret    

c0108455 <srand>:
/* *
 * srand - seed the random number generator with the given number
 * @seed:   the required seed number
 * */
void
srand(unsigned int seed) {
c0108455:	f3 0f 1e fb          	endbr32 
c0108459:	55                   	push   %ebp
c010845a:	89 e5                	mov    %esp,%ebp
    next = seed;
c010845c:	8b 45 08             	mov    0x8(%ebp),%eax
c010845f:	ba 00 00 00 00       	mov    $0x0,%edx
c0108464:	a3 58 2a 12 c0       	mov    %eax,0xc0122a58
c0108469:	89 15 5c 2a 12 c0    	mov    %edx,0xc0122a5c
}
c010846f:	90                   	nop
c0108470:	5d                   	pop    %ebp
c0108471:	c3                   	ret    
